Merge from themes-2. See the ChangeLog for a somewhat detailed
authorOwen Taylor <otaylor@src.gnome.org>
Fri, 6 Nov 1998 22:05:02 +0000 (22:05 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Fri, 6 Nov 1998 22:05:02 +0000 (22:05 +0000)
history of the evolution of the changes involved. Most of this
is actually minor painting tweaks.

110 files changed:
.cvsignore
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
Makefile.in [deleted file]
TODO
config.h.in
configure.in
docs/Changes-1.2.txt
docs/Makefile.in [deleted file]
examples/filesel/Makefile
gdk/Makefile.am
gdk/gdk.c
gdk/gdk.h
gdk/gdkcursors.h
gdk/gdkdnd.c
gdk/gdkgc.c
gdk/gdkimage.c
gdk/gdkinputxfree.h
gdk/gdkprivate.h
gdk/gdkrectangle.c
gdk/gdkrgb.c
gdk/gdkwindow.c
gdk/makecursors.awk [deleted file]
gdk/makekeysyms.awk [deleted file]
gdk/x11/gdkdnd-x11.c
gdk/x11/gdkimage-x11.c
gdk/x11/gdkinput-xfree.c
gdk/x11/gdkmain-x11.c
gdk/x11/gdkwindow-x11.c
gtk/Makefile.am
gtk/Makefile.in [deleted file]
gtk/genmarshal.pl
gtk/gtk.h
gtk/gtkarrow.c
gtk/gtkaspectframe.c
gtk/gtkbin.c
gtk/gtkbox.c
gtk/gtkbutton.c
gtk/gtkcheckbutton.c
gtk/gtkcheckmenuitem.c
gtk/gtkcolorsel.c
gtk/gtkcontainer.c
gtk/gtkcontainer.h
gtk/gtkcurve.c
gtk/gtkdnd.c
gtk/gtkdnd.h
gtk/gtkdrawwindow.c [new file with mode: 0644]
gtk/gtkdrawwindow.h [new file with mode: 0644]
gtk/gtkentry.c
gtk/gtkfixed.c
gtk/gtkframe.c
gtk/gtkhandlebox.c
gtk/gtkhpaned.c
gtk/gtkhruler.c
gtk/gtkhscale.c
gtk/gtkhscrollbar.c
gtk/gtkhseparator.c
gtk/gtkinvisible.h
gtk/gtkitem.c
gtk/gtklabel.c
gtk/gtklabel.h
gtk/gtklistitem.c
gtk/gtkmenu.c
gtk/gtkmenubar.c
gtk/gtkmenuitem.c
gtk/gtkmisc.c
gtk/gtknotebook.c
gtk/gtkoptionmenu.c
gtk/gtkpaned.c
gtk/gtkpixmap.c
gtk/gtkpixmap.h
gtk/gtkpreview.c
gtk/gtkprogressbar.c
gtk/gtkradiobutton.c
gtk/gtkradiomenuitem.c
gtk/gtkrange.c
gtk/gtkrange.h
gtk/gtkrc.c
gtk/gtkrc.h
gtk/gtkruler.c
gtk/gtkscale.c
gtk/gtkspinbutton.c
gtk/gtkstyle.c
gtk/gtkstyle.h
gtk/gtktearoffmenuitem.c
gtk/gtktext.c
gtk/gtkthemes.c [new file with mode: 0644]
gtk/gtkthemes.h [new file with mode: 0644]
gtk/gtktogglebutton.c
gtk/gtktogglebutton.h
gtk/gtktooltips.c
gtk/gtktreeitem.c
gtk/gtkviewport.c
gtk/gtkvpaned.c
gtk/gtkvruler.c
gtk/gtkvscale.c
gtk/gtkvscrollbar.c
gtk/gtkvseparator.c
gtk/gtkwidget.c
gtk/gtkwidget.h
gtk/gtkwindow.c
gtk/testgtk.c
gtk/testgtkrc
tests/testgtk.c
tests/testgtkrc

index c7a91a1f3496e9d3f0cf9ba5f419bc78a913474b..ee503cce01202a344df0c0c142abbf6771a97806 100644 (file)
@@ -10,4 +10,3 @@ aclocal.m4
 configure
 gtk-config
 config.cache
-
index 864a7fc11cde495972523895fc15612d45af221f..bf6f251c545cc460beaed3d857d427298393c5e5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,544 @@
+Thu Nov  5 12:06:16 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkcheckbutton.c (gtk_check_button_draw_focus): Queue
+       a clear/redraw, not just a redraw, so the focus
+       gets undrawn properly.
+
+       * gtk/gtktogglebutton.c (gtk_toggle_button_unrealize): 
+       Chain to gtk_widget_unrealize() instead of duplicating
+       code.
+
+Wed Nov  4 14:34:51 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdk.c gdk/gdkprivate.h gdk/gdkwindow.c: Removed
+       last vestiges of old DND.
+
+Tue Nov  3 12:27:52 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkentry.c: Restored inner border to entries,
+       erase cursors to background image.
+
+Fri Oct 30 12:09:21 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkentry.c gtk/gtkstyle.[ch]: removed paint_entry() -
+       it was identical to paint_flat_box().
+
+       * gtk/gtkstyle.c: Coding style fixups.
+
+       * gtk/gtkwindow.c (gtk_window_move_resize): removed useless
+       test.
+
+       * gtk/gtkframe.c gtkstyle.[ch] gtknotebook.c: 
+       Change 'side' for paint_[box/shadow]_gap and paint_extension
+       to be GtkPositionType instead of a random int.
+
+       * gtk/gtkaspectframe.c (gtk_aspect_frame_paint): Use 
+       "frame" as detail - an aspectframe should draw identical
+       to a frame.
+
+Tue Oct 27 09:58:11 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkwindow.c (gdk_window_merge_child_shapes): renamed
+       from combine_child_shapes().
+
+       * gdk/gdkwindow.c: Merge propagate_shapes() and
+       propagate_combine_shapes() to remove code duplication.
+
+Thu Nov  5 14:31:57 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdk.c: sometimes we get a KeyRelease before a KeyPress in
+       gdk_event_translate, and the USE_XIM buffer isn't allocated yet.
+       So allocate some mem if it's not already done.
+
+       * clist scrollbar merges from HEAD
+
+Tue Nov  3 13:16:36 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gtk/Makefile.am: remove explict -ldl, gmodule takes care of that
+
+       * gtk/gtkdnd.c: start TARGET_MOTIF_SUCCESS from 0x40000000 instead
+       of 0x80000000, so we stay within the bounds of a postive signed
+       int (it broke some compilers)
+
+       * gtk/gtkmenushell.c
+       * gtk/gtkoptionmenu.c: merges from HEAD to make option menus work
+       when some of the menuitems are hidden
+
+       * gtk/gtkthemes.h: don't include dlfcn.h explictly, gmodule takes
+       care of that
+
+       * gtk/gtkwidget.c: add a dummy continue after the line label
+       next_rect, since some compilers don't like label: }
+
+Sun Nov  1 20:05:55 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * Okay, so we need the X11R6 keysyms so programs don't have to
+       worry about them. They don't conflict anyway. Reverted the #ifdef
+       changes to gtk/*.c
+
+       * gdk/Makefile.am: remove the BUILT_SOURCES rule, and make a
+       special rule for them (X-derived-headers)
+
+Sun Nov  1 05:30:32 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/Makefile.am: changed the awk scripts to generate gdkcursors.h
+       and gdkkeysyms.h into sed scripts, since the awk scripts weren't
+       portable, and we really shouldn't be using awk anyway.
+
+       * makecursors.awk
+       * makekeysyms.awk: bye bye
+
+       * gtk/gtkaccelgroup.c
+       * gtk/gtkclist.c
+       * gtk/gtknotebook.c
+       * gtk/gtkwindow.c: don't use X11R6 keysyms if they aren't there
+
+Sat Oct 31 15:22:14 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/Makefile.am: do the same built sources trick for gdkcursors.h
+       and gdkkeysyms.h. Remove those files from CVS.
+
+Sat Oct 31 14:44:01 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdk.c: move prototype of gdk_wm_protocols_filter outside
+       of the USE_XIM #ifdef
+
+       * gtk/Makefile.am: cause the built sources to be rebuild when possible,
+        even with --include-deps. Slightly different from timj's fix, to avoid
+       circular dependency with gtkmarshal.c
+
+       * autogen.sh
+       * gtk/gtkclist.[ch]
+       * gtk/gtkctree.c
+       * gtk/gtkfontsel.[ch]
+       * gtk/gtklist.c
+       * gtk/gtklistitem.c
+       * gtk/gtkobject.[ch]
+       * gtk/testgtk.c: merges from HEAD
+
+       * gtk/gtkmenubar.c
+       * gtk/gtkradiomenuitem.c
+       * gtk/gtktreeitem.c: cleanups
+
+Wed Oct 28 23:32:19 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdkrgb.c: Oops. s/BIGENDIAN/BIG_ENDIAN/
+
+Wed Oct 28 19:04:49 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * configure.in: AIX has libpthreads, to make sure you can have
+       more than one thread. Also add -D_THREAD_SAFE, and reorder
+       configure.in so CFLAGS doesn't get clobbered when we actually
+       want to modify it
+
+       * gdk/gdkimage.c: initialize the bpp and byte_order fields properly
+       in gdk_image_get
+
+       * gtk/testdnd.c: removed unused variable "buf"
+
+Mon Oct 26 16:46:15 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkcontainer.c (gtk_container_unregister_toplevel): 
+       remove_link(), not remove()
+
+Thu Oct 22 02:27:30 PDT 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdkrgb.c: use glib endian stuff
+
+       * configure.in: don't need to check for endianness anymore
+
+       * gtk/gtkstyle.h: removed #pragma }, causing a silly warning
+
+Wed Oct 21 17:44:27 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_read_rcfiles): Reset
+       all toplevel widgets, not toplevel windows. (I.e.,
+       plugs should be reset)
+
+       * gtk/gtkwindow.c (gtk_window_read_rcfiles): Yes, we
+       _do_ need to notify the other toplevels - by the time
+       the get the client messages, the RC file dates will
+       have been updated.
+
+       * gtk/gtkcontainer.h: Added a function call to list
+       every toplevel widget.
+
+       * gdk/gdk.c (gdk_event_send_client_message_to_all_recurse): 
+       Don't send client messages to _every_ window on display!
+       
+Tue Oct 20 16:21:04 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkdnd.c (gtk_drag_source_event_cb): Don't start drags 
+       when dragging across widgets, only in drags
+       starting in widget.
+
+Tue Oct 20 15:59:49 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkdnd.c (gtk_drag_source_info_destroy): 
+       Emit "drag_end" signal at end of drag.
+
+Tue Oct 20 13:07:54 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_read_rcfiles): Look
+       for "gtk-embedded" data currently set by 
+       GtkSocket, and use that to forward client message
+       on to embedded windows. Only reset our own toplevel -
+       the others will handle themselves. (Now that
+       GtkMenus live in GtkWindows)
+
+Mon Oct 19 16:40:40 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkdnd.c (get_client_window_at_coords_recurse): Modify
+       client window finding code so that it works with
+       WM's other than fvwm.
+Sun Oct 18 22:48:27 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkdrawwindow.c (gtk_draw_window_get_type): Added
+       the "GtkDrawWindow" class, which is a descendent
+       of the Window class which leaves its background alone.
+       Essentially, a toplevel drawing area, though it does
+       allow adding a child.
+
+Sat Oct 17 00:40:51 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrc.c (gtk_rc_style_init): Duplicate bg_pixmap_name when
+       merging RC styles. Report new share/themes path for
+       themes directory. Deref theme engines when appropriate.
+
+       * gtk/gtkclist.c: Set all backgrounds in _style_set().
+       Make sure that pixel for xor_gc is never 0.
+
+       * gtk/gtkctree.c: Choose colors for plus/minus more
+       carefully, in a hopefully style-independent fashion.
+       (Still needs a bit more work)
+
+       * gtk/gtkwidget.c: Don't send expose events to widgets
+       which are about to be resized and redrawn. (Needs a
+       bit more thought.)
+
+       * gtk/gtknotebook.c (gtk_notebook_draw_tab): Avoid
+       drawing on tabs for newly allocated, un-sized
+       pages - we'll get the size wrong.
+
+Thu Oct  1 17:38:07 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c (gtk_widget_redraw_queue_remove): Fixed
+       up stupidities in last commit.
+
+Thu Oct  1 14:25:43 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c: When handling queued resizes, account
+       for handleboxes, where the widget heirarchy is different
+       than the window heirarchy by just queueing a resize on
+       the entire handlebox if the detached child is changed.
+
+       - Remove widgets from the redraw queue when reparenting,
+       even if not unrealizing. We queue a resize/redraw in
+       any case.
+
+Mon Sep 28 21:07:01 EDT 1998 The Rasterman <raster@redhat.com>
+       * gtk/gtkstyle.c: added check to see if the widget has been shaped
+       byt the app via gtk_widget_shape_combine_mask and if it has does
+       not reset the shape on theme change.
+       
+Tue Sep 15 11:30:03 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkfilesel.c: Keep a list of directories in which we never
+       want to stat the entries (like /afs), and assume everything in
+       those directories is a subdirectory.
+
+       - When following a path, try to open components even when
+       we don't find them in their parent's directory to
+       support automounters.
+
+Fri Sep 11 15:36:33 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully
+       now at least compiles again.
+
+       * gdk/gdk.c (gdk_event_translate): Don't pass events
+       on destroyed widgets to the gdk_input layer.
+
+Thu Sep  3 19:45:34 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkthemes.c: Use g_module instead of dlopen()
+
+Thu Sep  3 19:30:11 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktooltips.c (gtk_tooltips_expose): Check
+       if we've changed widgets since the expose event
+       was queued.
+
+Mon Aug 31 15:33:13 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.h (struct _GtkStyle): Reordered a bit
+       to restore approximate bin compatibility with the
+       non-themes branch. (This does break bin compat
+       within the themes branch.)
+
+Sun Aug 30 16:48:27 1998  Owen Taylor  <otaylor@gtk.org>
+
+       * gtk/gtklabel.c (gtk_label_set): Eliminate a 
+       gdk_window_clear_area() that snuck in with the
+       menu underlines merge.
+
+Mon Aug 24 23:37:26 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktext.c: Fixed some remaining background drawing,
+         merges from main branch, cleanups.
+
+Mon Aug 24 10:55:51 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_draw_tab): Don't
+         dereference NULL focus tab.
+
+       * gtk/gtkscale.c (gtk_scale_[un]map): Add map/unmap
+         functions since we need to both show/hide and 
+         queue a redraw. (There's some duplication of drawing here, 
+         we probably should only be queuing a redraw on the
+         "value" portion of the scale.)
+
+Fri Aug 21 19:02:30 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrange.[ch] gtk/gtkhscale.c gtk/gtkvscale.[ch]: Fit scales
+         into the theme-drawing framework. We do this by making them,
+         like check/radio-buttons, no-window widgets with subwindows. We
+         then move the value by calling gtk_widget_queue_clear() and only
+         redraw the value in our draw() / expose() handler.  A virtual
+         function clear_background is added which queues a clear on the
+         "background" portion of the widget.
+
+Fri Aug 21 13:04:27 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktext.c (mark_bg_gc): Make background colors work
+         again. (We can't always paint the background with a
+         paint() function - only do that for selected text)
+
+Mon Aug 17 20:31:01 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktearoffmenuitem.c gtk/gtkclist.[ch] gtk/gtkctree.[ch]
+         gtk/gtklabel.c gtk/gtkmenu.c: Merges from main branch.
+
+       * Makefile.am (SRC_SUBDIRS): Removed themes from SRC_SUBDIRS.
+         the themes can't be built as part of the same build since
+         they depend on gdk_imlib.
+
+Fri Aug 14 12:44:30 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkthemes.c (gtk_theme_engine_get): Removed sample engine code
+         from gtkthemes.c.
+               
+       * configure.in ltconfig.in ltmain.sh gdk/Makefile.am gtk/Makefile.am
+         gtk/
+
+         - Upgrade to libtool-1.2b + patch to add shared library dependencies
+           for Linux. (Needs to be extended to other platforms where they
+           are safe)
+
+        - Check for -ldl so this branch should build on all platforms, though
+          themes will work on all platforms they could work on.
+
+        - Use -version and -release simultaneously: sonames stay as they are
+          in the current scheme, but -lgtk-1.1 changes to -lgtk.
+
+        - Added in extra -l flags to library LDFLAGS so we get shared library
+          dependencies against X libs and -ldl. (But not libgtk against 
+          libgdk or libglib yet, since dependencies against uninstalled
+          libraries aren't portable)
+
+Fri Aug 21 16:10:38 EDT 1998 The Rasterman <raster@redhat.com>
+       * gtkrc.c - added api calls to find module and theme paths from gtk.
+         nuked gtk_install_prefix global.
+       
+Fri Aug 21 12:36:46 EDT 1998 The Rasterman <raster@redhat.com>
+       * fixed gtk_install_prefix global.
+         
+Thu Aug 20 19:27:49 EDT 1998 The Rasterman <raster@redhat.com>
+       * added gtk_install_prefix global const variabel to find where gtk is
+         installed.
+         
+Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
+       * added ~/.gtk/lib/themes/engines/ to the default searchpath for
+         gtk theme engines
+       
+Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
+       * made gtkrc scanner append dir that gtkrc is read from to pixmap path.
+
+Mon Aug 10 23:03:55 1998  The Rasterman <raster@redhat.com>
+       * Fixed minor problem in gtkhandlebox.c with drawing, and some
+         notebook stuff. Also pixmap theme is now "clean" again.
+         
+Mon Aug 10 23:03:55 1998  Owen Taylor  <otaylor@redhat.com>
+       * gtk/gtkwidget.c (gtk_widget_clip_rect): Fixed up 
+         queued area resizing once more.
+
+Mon Aug 10 23:09:30 EDT 1998
+       * Added a few drawing fixes for notebook and other widgets. finished
+         pixmap theme up to the level that can be supported so far. (need to
+         add path discovery 9ie where is the rc fiel from - add to pixmap 
+         path so we can get theimages from there too). then we can package 
+         themes. After that need to add to theme seartch path stuff in users 
+         home dir.
+         
+Thu Aug  6 16:49:25 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a
+         drawing area, draw in an expose handler.
+
+       * gtk/gtknotebook.c (gtk_notebook_expose): Check for
+         empty current page.
+
+Wed Aug  5 16:13:15 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved
+         creation of GC's so that they will be set before
+         they are used for map events (why are they used there?)
+
+       * gtk/gtkwidget.c: Fixed mistake that caused widgets to
+         be queued in multiple times in the queue.
+
+Wed Aug  5 14:23:52 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set
+         clip rects (or do anything) for shadow_none.
+
+Wed Aug  5 13:14:57 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkbutton.c (gtk_button_paint): Restored paint function.
+         Yes, it was needed. draw() and expose() are _not_
+         identical.
+
+Sat Aug  1 17:44:31 EDT 1998 EDT 1998 The Rasterman <raster@redhat.com>
+       * Wheeeeeeeeeeeeeeee fixed radiobittons to work in gimp again.
+
+Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
+       * YES YES YES YES YES clist borders work again! YES! YES YES! gimme 
+         more baby oooh yeah more more MORE YES YES.
+
+Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
+       * hopefully fixed problem wiht togglebuttons acting like
+          radiobuttons in gtktogglebutton.c
+
+Thu Jul 30 23:36:46 EDT 1998 The Rasterman <raster@redhat.com>
+       * fixed another drawing buglet in the frame drawing code (actually
+         in the clearing code but anyway in gtkstyle.c)
+
+Thu Jul 30 19:23:48 EDT 1998 The Rasterman <raster@redhat.com>
+       * Fixed warning from colorsel widget...
+
+Thu Jul 30 19:10:42 EDT 1998 The Rasterman <raster@redhat.com>
+       * Fixed defautl drawing code to no longer clobber the original style
+         pixmap bgs as it did and added a helper funciton og gtkstyle.c to
+         help with this.
+
+Thu Jul 30 18:09:21 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrc.c gtk/gtkstyle.c: More mm fixups
+
+       * gtk/gtktooltips.c: Pass a widget (the window) to the
+         drawing function instead of the GtkTooltips.
+
+Thu Jul 30 17:27:10 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkwindow.c: Abstract out checking for shape
+         extension into a function.
+
+       * gtk/gtkwindow.c: Fix up gtk_window_expose()/draw().
+         Remove extra callls to gtk_window_draw().
+
+Thu Jul 30 11:18:43 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.c gtk/gtkrc.c: Memory management fixups.
+
+       * themes/th_main.c: Moved messages around so they are
+         printed before destroying strings.
+
+Wed Jul 29 16:56:07 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdk.c: Fairly simple implementation of expose compression.
+         (No GraphicsExpose compression yet, always compress
+         with the equivalent of XtCompressMultiple - no compression
+         of Expose events across non-Expose events)
+       
+       * gdk/gdk.h gdk/gdkrectangle.c: gdk_rectangle_union()
+         Find rectangle bounding two rectangles.
+
+       * gtk/gtkstyle.c: Set clip rects for a few extra GC's
+         in gdk_default_draw_shadow()
+       
+Wed Jul 29 16:03:20 EDT 1998 The Rasterman <raster@redhat.com>
+       * Fixed drawing functions to handle switching themes on the fly 
+         gracefully and look decent.
+         
+Tue Jul 28 22:52:10 EDT 1998 The Rasterman <raster@redhat.com>
+       * Added all the theme drawing code to all widgets, fixed up minor
+          nigglies in some widgets when it comes to themes, seem to be
+          running into some funky behavior with clipping rects in GC's. Too
+          many files to list here. (all files that now use gtk_paint_* are
+         affected).
+
+Tue Jul 28 22:49:16 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * themes/th_main.c themes/th_draw.c gtk/testgtkrc: 
+         Set up the demo theme so it is loaded from the RC file.
+
+       * themes/th_draw.c: Alleviate the hardcoded paths a wee
+         bit. (use $HOME/themes/)
+
+       * gtk/gtkthemes.[ch] gtk/gtkmain.c: Load engines specified in 
+         the RC file via dlopen()
+
+Tue Jul 28 20:30:56 1998  Owen Taylor  <otaylor@redhat.com>
+
+       Internal handling of styles and RC styles pretty much
+       completely reworked for Theme work.
+
+       * gtkthemes.[ch]: 
+        - Added routines for virtualization of RcStyle and Style handling.
+        - Temporary "sample" inline theme-engine. (Does nothing
+          but print out a few messages.
+       
+       * gtkrc.[ch]
+        - Made GtkRcStyle public, added flags to tell if particular
+          colors have been set.
+        - RC Styles are "transparent", and the final style for
+          a widget is the composition of all matching styles
+        - Added pointer to GtkThemeEngine, and gpointer engine_data
+          to RC style and style.
+        - Parse "engine" keyword, load the appropriate theme engine
+          and call the engine's parser.
+       
+       *  gtkstyle.[ch]
+        - Keep a GtkRcStyle * in styles created from Rc Styles.
+        - Load up images from RC file at style attachment time.
+         - Call ->engine->foo() at appropriate times.
+        - Don't use a GCache. All incarnations for a style are
+          just linked together in a list, depend on the RC style 
+          code to find the existing copy.
+
+Tue Jul 28 14:41:54 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.[ch]: Added the concept of queued redraws
+         of partial areas. This can be done either relative
+         to the existing windows (gtk_widget_queue_clear[_area]())
+         or relative to the future allocation of the widget
+         (gtk_widget_queue_draw[_area]). 
+
+         The initial implementation is pretty braindead, but
+         can be improved.
+
+       * gtk/gtkwidget.[ch]: Removed calls to gdk_window_clear_area()
+         in favor of gtk_widget_queue_clear().
+       
+       * gtk/gtklabel.[ch] gtk/gtkpixmap.[ch]: Removed needs_clear
+         flags in favor of gtk_widget_queue_clear()
+       
+Tue Aug  4 19:12:14 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up
+         handling of partially clipped areas.
+
 Thu Nov  5 18:52:35 1998  Lars Hamann  <lars@gtk.org>
 
        * gtk/gtkclist.h (struct _GtkCListClass)
index 864a7fc11cde495972523895fc15612d45af221f..bf6f251c545cc460beaed3d857d427298393c5e5 100644 (file)
@@ -1,3 +1,544 @@
+Thu Nov  5 12:06:16 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkcheckbutton.c (gtk_check_button_draw_focus): Queue
+       a clear/redraw, not just a redraw, so the focus
+       gets undrawn properly.
+
+       * gtk/gtktogglebutton.c (gtk_toggle_button_unrealize): 
+       Chain to gtk_widget_unrealize() instead of duplicating
+       code.
+
+Wed Nov  4 14:34:51 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdk.c gdk/gdkprivate.h gdk/gdkwindow.c: Removed
+       last vestiges of old DND.
+
+Tue Nov  3 12:27:52 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkentry.c: Restored inner border to entries,
+       erase cursors to background image.
+
+Fri Oct 30 12:09:21 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkentry.c gtk/gtkstyle.[ch]: removed paint_entry() -
+       it was identical to paint_flat_box().
+
+       * gtk/gtkstyle.c: Coding style fixups.
+
+       * gtk/gtkwindow.c (gtk_window_move_resize): removed useless
+       test.
+
+       * gtk/gtkframe.c gtkstyle.[ch] gtknotebook.c: 
+       Change 'side' for paint_[box/shadow]_gap and paint_extension
+       to be GtkPositionType instead of a random int.
+
+       * gtk/gtkaspectframe.c (gtk_aspect_frame_paint): Use 
+       "frame" as detail - an aspectframe should draw identical
+       to a frame.
+
+Tue Oct 27 09:58:11 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkwindow.c (gdk_window_merge_child_shapes): renamed
+       from combine_child_shapes().
+
+       * gdk/gdkwindow.c: Merge propagate_shapes() and
+       propagate_combine_shapes() to remove code duplication.
+
+Thu Nov  5 14:31:57 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdk.c: sometimes we get a KeyRelease before a KeyPress in
+       gdk_event_translate, and the USE_XIM buffer isn't allocated yet.
+       So allocate some mem if it's not already done.
+
+       * clist scrollbar merges from HEAD
+
+Tue Nov  3 13:16:36 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gtk/Makefile.am: remove explict -ldl, gmodule takes care of that
+
+       * gtk/gtkdnd.c: start TARGET_MOTIF_SUCCESS from 0x40000000 instead
+       of 0x80000000, so we stay within the bounds of a postive signed
+       int (it broke some compilers)
+
+       * gtk/gtkmenushell.c
+       * gtk/gtkoptionmenu.c: merges from HEAD to make option menus work
+       when some of the menuitems are hidden
+
+       * gtk/gtkthemes.h: don't include dlfcn.h explictly, gmodule takes
+       care of that
+
+       * gtk/gtkwidget.c: add a dummy continue after the line label
+       next_rect, since some compilers don't like label: }
+
+Sun Nov  1 20:05:55 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * Okay, so we need the X11R6 keysyms so programs don't have to
+       worry about them. They don't conflict anyway. Reverted the #ifdef
+       changes to gtk/*.c
+
+       * gdk/Makefile.am: remove the BUILT_SOURCES rule, and make a
+       special rule for them (X-derived-headers)
+
+Sun Nov  1 05:30:32 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/Makefile.am: changed the awk scripts to generate gdkcursors.h
+       and gdkkeysyms.h into sed scripts, since the awk scripts weren't
+       portable, and we really shouldn't be using awk anyway.
+
+       * makecursors.awk
+       * makekeysyms.awk: bye bye
+
+       * gtk/gtkaccelgroup.c
+       * gtk/gtkclist.c
+       * gtk/gtknotebook.c
+       * gtk/gtkwindow.c: don't use X11R6 keysyms if they aren't there
+
+Sat Oct 31 15:22:14 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/Makefile.am: do the same built sources trick for gdkcursors.h
+       and gdkkeysyms.h. Remove those files from CVS.
+
+Sat Oct 31 14:44:01 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdk.c: move prototype of gdk_wm_protocols_filter outside
+       of the USE_XIM #ifdef
+
+       * gtk/Makefile.am: cause the built sources to be rebuild when possible,
+        even with --include-deps. Slightly different from timj's fix, to avoid
+       circular dependency with gtkmarshal.c
+
+       * autogen.sh
+       * gtk/gtkclist.[ch]
+       * gtk/gtkctree.c
+       * gtk/gtkfontsel.[ch]
+       * gtk/gtklist.c
+       * gtk/gtklistitem.c
+       * gtk/gtkobject.[ch]
+       * gtk/testgtk.c: merges from HEAD
+
+       * gtk/gtkmenubar.c
+       * gtk/gtkradiomenuitem.c
+       * gtk/gtktreeitem.c: cleanups
+
+Wed Oct 28 23:32:19 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdkrgb.c: Oops. s/BIGENDIAN/BIG_ENDIAN/
+
+Wed Oct 28 19:04:49 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * configure.in: AIX has libpthreads, to make sure you can have
+       more than one thread. Also add -D_THREAD_SAFE, and reorder
+       configure.in so CFLAGS doesn't get clobbered when we actually
+       want to modify it
+
+       * gdk/gdkimage.c: initialize the bpp and byte_order fields properly
+       in gdk_image_get
+
+       * gtk/testdnd.c: removed unused variable "buf"
+
+Mon Oct 26 16:46:15 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkcontainer.c (gtk_container_unregister_toplevel): 
+       remove_link(), not remove()
+
+Thu Oct 22 02:27:30 PDT 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdkrgb.c: use glib endian stuff
+
+       * configure.in: don't need to check for endianness anymore
+
+       * gtk/gtkstyle.h: removed #pragma }, causing a silly warning
+
+Wed Oct 21 17:44:27 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_read_rcfiles): Reset
+       all toplevel widgets, not toplevel windows. (I.e.,
+       plugs should be reset)
+
+       * gtk/gtkwindow.c (gtk_window_read_rcfiles): Yes, we
+       _do_ need to notify the other toplevels - by the time
+       the get the client messages, the RC file dates will
+       have been updated.
+
+       * gtk/gtkcontainer.h: Added a function call to list
+       every toplevel widget.
+
+       * gdk/gdk.c (gdk_event_send_client_message_to_all_recurse): 
+       Don't send client messages to _every_ window on display!
+       
+Tue Oct 20 16:21:04 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkdnd.c (gtk_drag_source_event_cb): Don't start drags 
+       when dragging across widgets, only in drags
+       starting in widget.
+
+Tue Oct 20 15:59:49 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkdnd.c (gtk_drag_source_info_destroy): 
+       Emit "drag_end" signal at end of drag.
+
+Tue Oct 20 13:07:54 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_read_rcfiles): Look
+       for "gtk-embedded" data currently set by 
+       GtkSocket, and use that to forward client message
+       on to embedded windows. Only reset our own toplevel -
+       the others will handle themselves. (Now that
+       GtkMenus live in GtkWindows)
+
+Mon Oct 19 16:40:40 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkdnd.c (get_client_window_at_coords_recurse): Modify
+       client window finding code so that it works with
+       WM's other than fvwm.
+Sun Oct 18 22:48:27 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkdrawwindow.c (gtk_draw_window_get_type): Added
+       the "GtkDrawWindow" class, which is a descendent
+       of the Window class which leaves its background alone.
+       Essentially, a toplevel drawing area, though it does
+       allow adding a child.
+
+Sat Oct 17 00:40:51 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrc.c (gtk_rc_style_init): Duplicate bg_pixmap_name when
+       merging RC styles. Report new share/themes path for
+       themes directory. Deref theme engines when appropriate.
+
+       * gtk/gtkclist.c: Set all backgrounds in _style_set().
+       Make sure that pixel for xor_gc is never 0.
+
+       * gtk/gtkctree.c: Choose colors for plus/minus more
+       carefully, in a hopefully style-independent fashion.
+       (Still needs a bit more work)
+
+       * gtk/gtkwidget.c: Don't send expose events to widgets
+       which are about to be resized and redrawn. (Needs a
+       bit more thought.)
+
+       * gtk/gtknotebook.c (gtk_notebook_draw_tab): Avoid
+       drawing on tabs for newly allocated, un-sized
+       pages - we'll get the size wrong.
+
+Thu Oct  1 17:38:07 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c (gtk_widget_redraw_queue_remove): Fixed
+       up stupidities in last commit.
+
+Thu Oct  1 14:25:43 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c: When handling queued resizes, account
+       for handleboxes, where the widget heirarchy is different
+       than the window heirarchy by just queueing a resize on
+       the entire handlebox if the detached child is changed.
+
+       - Remove widgets from the redraw queue when reparenting,
+       even if not unrealizing. We queue a resize/redraw in
+       any case.
+
+Mon Sep 28 21:07:01 EDT 1998 The Rasterman <raster@redhat.com>
+       * gtk/gtkstyle.c: added check to see if the widget has been shaped
+       byt the app via gtk_widget_shape_combine_mask and if it has does
+       not reset the shape on theme change.
+       
+Tue Sep 15 11:30:03 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkfilesel.c: Keep a list of directories in which we never
+       want to stat the entries (like /afs), and assume everything in
+       those directories is a subdirectory.
+
+       - When following a path, try to open components even when
+       we don't find them in their parent's directory to
+       support automounters.
+
+Fri Sep 11 15:36:33 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully
+       now at least compiles again.
+
+       * gdk/gdk.c (gdk_event_translate): Don't pass events
+       on destroyed widgets to the gdk_input layer.
+
+Thu Sep  3 19:45:34 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkthemes.c: Use g_module instead of dlopen()
+
+Thu Sep  3 19:30:11 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktooltips.c (gtk_tooltips_expose): Check
+       if we've changed widgets since the expose event
+       was queued.
+
+Mon Aug 31 15:33:13 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.h (struct _GtkStyle): Reordered a bit
+       to restore approximate bin compatibility with the
+       non-themes branch. (This does break bin compat
+       within the themes branch.)
+
+Sun Aug 30 16:48:27 1998  Owen Taylor  <otaylor@gtk.org>
+
+       * gtk/gtklabel.c (gtk_label_set): Eliminate a 
+       gdk_window_clear_area() that snuck in with the
+       menu underlines merge.
+
+Mon Aug 24 23:37:26 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktext.c: Fixed some remaining background drawing,
+         merges from main branch, cleanups.
+
+Mon Aug 24 10:55:51 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_draw_tab): Don't
+         dereference NULL focus tab.
+
+       * gtk/gtkscale.c (gtk_scale_[un]map): Add map/unmap
+         functions since we need to both show/hide and 
+         queue a redraw. (There's some duplication of drawing here, 
+         we probably should only be queuing a redraw on the
+         "value" portion of the scale.)
+
+Fri Aug 21 19:02:30 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrange.[ch] gtk/gtkhscale.c gtk/gtkvscale.[ch]: Fit scales
+         into the theme-drawing framework. We do this by making them,
+         like check/radio-buttons, no-window widgets with subwindows. We
+         then move the value by calling gtk_widget_queue_clear() and only
+         redraw the value in our draw() / expose() handler.  A virtual
+         function clear_background is added which queues a clear on the
+         "background" portion of the widget.
+
+Fri Aug 21 13:04:27 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktext.c (mark_bg_gc): Make background colors work
+         again. (We can't always paint the background with a
+         paint() function - only do that for selected text)
+
+Mon Aug 17 20:31:01 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktearoffmenuitem.c gtk/gtkclist.[ch] gtk/gtkctree.[ch]
+         gtk/gtklabel.c gtk/gtkmenu.c: Merges from main branch.
+
+       * Makefile.am (SRC_SUBDIRS): Removed themes from SRC_SUBDIRS.
+         the themes can't be built as part of the same build since
+         they depend on gdk_imlib.
+
+Fri Aug 14 12:44:30 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkthemes.c (gtk_theme_engine_get): Removed sample engine code
+         from gtkthemes.c.
+               
+       * configure.in ltconfig.in ltmain.sh gdk/Makefile.am gtk/Makefile.am
+         gtk/
+
+         - Upgrade to libtool-1.2b + patch to add shared library dependencies
+           for Linux. (Needs to be extended to other platforms where they
+           are safe)
+
+        - Check for -ldl so this branch should build on all platforms, though
+          themes will work on all platforms they could work on.
+
+        - Use -version and -release simultaneously: sonames stay as they are
+          in the current scheme, but -lgtk-1.1 changes to -lgtk.
+
+        - Added in extra -l flags to library LDFLAGS so we get shared library
+          dependencies against X libs and -ldl. (But not libgtk against 
+          libgdk or libglib yet, since dependencies against uninstalled
+          libraries aren't portable)
+
+Fri Aug 21 16:10:38 EDT 1998 The Rasterman <raster@redhat.com>
+       * gtkrc.c - added api calls to find module and theme paths from gtk.
+         nuked gtk_install_prefix global.
+       
+Fri Aug 21 12:36:46 EDT 1998 The Rasterman <raster@redhat.com>
+       * fixed gtk_install_prefix global.
+         
+Thu Aug 20 19:27:49 EDT 1998 The Rasterman <raster@redhat.com>
+       * added gtk_install_prefix global const variabel to find where gtk is
+         installed.
+         
+Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
+       * added ~/.gtk/lib/themes/engines/ to the default searchpath for
+         gtk theme engines
+       
+Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
+       * made gtkrc scanner append dir that gtkrc is read from to pixmap path.
+
+Mon Aug 10 23:03:55 1998  The Rasterman <raster@redhat.com>
+       * Fixed minor problem in gtkhandlebox.c with drawing, and some
+         notebook stuff. Also pixmap theme is now "clean" again.
+         
+Mon Aug 10 23:03:55 1998  Owen Taylor  <otaylor@redhat.com>
+       * gtk/gtkwidget.c (gtk_widget_clip_rect): Fixed up 
+         queued area resizing once more.
+
+Mon Aug 10 23:09:30 EDT 1998
+       * Added a few drawing fixes for notebook and other widgets. finished
+         pixmap theme up to the level that can be supported so far. (need to
+         add path discovery 9ie where is the rc fiel from - add to pixmap 
+         path so we can get theimages from there too). then we can package 
+         themes. After that need to add to theme seartch path stuff in users 
+         home dir.
+         
+Thu Aug  6 16:49:25 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a
+         drawing area, draw in an expose handler.
+
+       * gtk/gtknotebook.c (gtk_notebook_expose): Check for
+         empty current page.
+
+Wed Aug  5 16:13:15 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved
+         creation of GC's so that they will be set before
+         they are used for map events (why are they used there?)
+
+       * gtk/gtkwidget.c: Fixed mistake that caused widgets to
+         be queued in multiple times in the queue.
+
+Wed Aug  5 14:23:52 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set
+         clip rects (or do anything) for shadow_none.
+
+Wed Aug  5 13:14:57 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkbutton.c (gtk_button_paint): Restored paint function.
+         Yes, it was needed. draw() and expose() are _not_
+         identical.
+
+Sat Aug  1 17:44:31 EDT 1998 EDT 1998 The Rasterman <raster@redhat.com>
+       * Wheeeeeeeeeeeeeeee fixed radiobittons to work in gimp again.
+
+Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
+       * YES YES YES YES YES clist borders work again! YES! YES YES! gimme 
+         more baby oooh yeah more more MORE YES YES.
+
+Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
+       * hopefully fixed problem wiht togglebuttons acting like
+          radiobuttons in gtktogglebutton.c
+
+Thu Jul 30 23:36:46 EDT 1998 The Rasterman <raster@redhat.com>
+       * fixed another drawing buglet in the frame drawing code (actually
+         in the clearing code but anyway in gtkstyle.c)
+
+Thu Jul 30 19:23:48 EDT 1998 The Rasterman <raster@redhat.com>
+       * Fixed warning from colorsel widget...
+
+Thu Jul 30 19:10:42 EDT 1998 The Rasterman <raster@redhat.com>
+       * Fixed defautl drawing code to no longer clobber the original style
+         pixmap bgs as it did and added a helper funciton og gtkstyle.c to
+         help with this.
+
+Thu Jul 30 18:09:21 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrc.c gtk/gtkstyle.c: More mm fixups
+
+       * gtk/gtktooltips.c: Pass a widget (the window) to the
+         drawing function instead of the GtkTooltips.
+
+Thu Jul 30 17:27:10 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkwindow.c: Abstract out checking for shape
+         extension into a function.
+
+       * gtk/gtkwindow.c: Fix up gtk_window_expose()/draw().
+         Remove extra callls to gtk_window_draw().
+
+Thu Jul 30 11:18:43 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.c gtk/gtkrc.c: Memory management fixups.
+
+       * themes/th_main.c: Moved messages around so they are
+         printed before destroying strings.
+
+Wed Jul 29 16:56:07 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdk.c: Fairly simple implementation of expose compression.
+         (No GraphicsExpose compression yet, always compress
+         with the equivalent of XtCompressMultiple - no compression
+         of Expose events across non-Expose events)
+       
+       * gdk/gdk.h gdk/gdkrectangle.c: gdk_rectangle_union()
+         Find rectangle bounding two rectangles.
+
+       * gtk/gtkstyle.c: Set clip rects for a few extra GC's
+         in gdk_default_draw_shadow()
+       
+Wed Jul 29 16:03:20 EDT 1998 The Rasterman <raster@redhat.com>
+       * Fixed drawing functions to handle switching themes on the fly 
+         gracefully and look decent.
+         
+Tue Jul 28 22:52:10 EDT 1998 The Rasterman <raster@redhat.com>
+       * Added all the theme drawing code to all widgets, fixed up minor
+          nigglies in some widgets when it comes to themes, seem to be
+          running into some funky behavior with clipping rects in GC's. Too
+          many files to list here. (all files that now use gtk_paint_* are
+         affected).
+
+Tue Jul 28 22:49:16 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * themes/th_main.c themes/th_draw.c gtk/testgtkrc: 
+         Set up the demo theme so it is loaded from the RC file.
+
+       * themes/th_draw.c: Alleviate the hardcoded paths a wee
+         bit. (use $HOME/themes/)
+
+       * gtk/gtkthemes.[ch] gtk/gtkmain.c: Load engines specified in 
+         the RC file via dlopen()
+
+Tue Jul 28 20:30:56 1998  Owen Taylor  <otaylor@redhat.com>
+
+       Internal handling of styles and RC styles pretty much
+       completely reworked for Theme work.
+
+       * gtkthemes.[ch]: 
+        - Added routines for virtualization of RcStyle and Style handling.
+        - Temporary "sample" inline theme-engine. (Does nothing
+          but print out a few messages.
+       
+       * gtkrc.[ch]
+        - Made GtkRcStyle public, added flags to tell if particular
+          colors have been set.
+        - RC Styles are "transparent", and the final style for
+          a widget is the composition of all matching styles
+        - Added pointer to GtkThemeEngine, and gpointer engine_data
+          to RC style and style.
+        - Parse "engine" keyword, load the appropriate theme engine
+          and call the engine's parser.
+       
+       *  gtkstyle.[ch]
+        - Keep a GtkRcStyle * in styles created from Rc Styles.
+        - Load up images from RC file at style attachment time.
+         - Call ->engine->foo() at appropriate times.
+        - Don't use a GCache. All incarnations for a style are
+          just linked together in a list, depend on the RC style 
+          code to find the existing copy.
+
+Tue Jul 28 14:41:54 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.[ch]: Added the concept of queued redraws
+         of partial areas. This can be done either relative
+         to the existing windows (gtk_widget_queue_clear[_area]())
+         or relative to the future allocation of the widget
+         (gtk_widget_queue_draw[_area]). 
+
+         The initial implementation is pretty braindead, but
+         can be improved.
+
+       * gtk/gtkwidget.[ch]: Removed calls to gdk_window_clear_area()
+         in favor of gtk_widget_queue_clear().
+       
+       * gtk/gtklabel.[ch] gtk/gtkpixmap.[ch]: Removed needs_clear
+         flags in favor of gtk_widget_queue_clear()
+       
+Tue Aug  4 19:12:14 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up
+         handling of partially clipped areas.
+
 Thu Nov  5 18:52:35 1998  Lars Hamann  <lars@gtk.org>
 
        * gtk/gtkclist.h (struct _GtkCListClass)
index 864a7fc11cde495972523895fc15612d45af221f..bf6f251c545cc460beaed3d857d427298393c5e5 100644 (file)
@@ -1,3 +1,544 @@
+Thu Nov  5 12:06:16 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkcheckbutton.c (gtk_check_button_draw_focus): Queue
+       a clear/redraw, not just a redraw, so the focus
+       gets undrawn properly.
+
+       * gtk/gtktogglebutton.c (gtk_toggle_button_unrealize): 
+       Chain to gtk_widget_unrealize() instead of duplicating
+       code.
+
+Wed Nov  4 14:34:51 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdk.c gdk/gdkprivate.h gdk/gdkwindow.c: Removed
+       last vestiges of old DND.
+
+Tue Nov  3 12:27:52 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkentry.c: Restored inner border to entries,
+       erase cursors to background image.
+
+Fri Oct 30 12:09:21 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkentry.c gtk/gtkstyle.[ch]: removed paint_entry() -
+       it was identical to paint_flat_box().
+
+       * gtk/gtkstyle.c: Coding style fixups.
+
+       * gtk/gtkwindow.c (gtk_window_move_resize): removed useless
+       test.
+
+       * gtk/gtkframe.c gtkstyle.[ch] gtknotebook.c: 
+       Change 'side' for paint_[box/shadow]_gap and paint_extension
+       to be GtkPositionType instead of a random int.
+
+       * gtk/gtkaspectframe.c (gtk_aspect_frame_paint): Use 
+       "frame" as detail - an aspectframe should draw identical
+       to a frame.
+
+Tue Oct 27 09:58:11 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkwindow.c (gdk_window_merge_child_shapes): renamed
+       from combine_child_shapes().
+
+       * gdk/gdkwindow.c: Merge propagate_shapes() and
+       propagate_combine_shapes() to remove code duplication.
+
+Thu Nov  5 14:31:57 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdk.c: sometimes we get a KeyRelease before a KeyPress in
+       gdk_event_translate, and the USE_XIM buffer isn't allocated yet.
+       So allocate some mem if it's not already done.
+
+       * clist scrollbar merges from HEAD
+
+Tue Nov  3 13:16:36 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gtk/Makefile.am: remove explict -ldl, gmodule takes care of that
+
+       * gtk/gtkdnd.c: start TARGET_MOTIF_SUCCESS from 0x40000000 instead
+       of 0x80000000, so we stay within the bounds of a postive signed
+       int (it broke some compilers)
+
+       * gtk/gtkmenushell.c
+       * gtk/gtkoptionmenu.c: merges from HEAD to make option menus work
+       when some of the menuitems are hidden
+
+       * gtk/gtkthemes.h: don't include dlfcn.h explictly, gmodule takes
+       care of that
+
+       * gtk/gtkwidget.c: add a dummy continue after the line label
+       next_rect, since some compilers don't like label: }
+
+Sun Nov  1 20:05:55 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * Okay, so we need the X11R6 keysyms so programs don't have to
+       worry about them. They don't conflict anyway. Reverted the #ifdef
+       changes to gtk/*.c
+
+       * gdk/Makefile.am: remove the BUILT_SOURCES rule, and make a
+       special rule for them (X-derived-headers)
+
+Sun Nov  1 05:30:32 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/Makefile.am: changed the awk scripts to generate gdkcursors.h
+       and gdkkeysyms.h into sed scripts, since the awk scripts weren't
+       portable, and we really shouldn't be using awk anyway.
+
+       * makecursors.awk
+       * makekeysyms.awk: bye bye
+
+       * gtk/gtkaccelgroup.c
+       * gtk/gtkclist.c
+       * gtk/gtknotebook.c
+       * gtk/gtkwindow.c: don't use X11R6 keysyms if they aren't there
+
+Sat Oct 31 15:22:14 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/Makefile.am: do the same built sources trick for gdkcursors.h
+       and gdkkeysyms.h. Remove those files from CVS.
+
+Sat Oct 31 14:44:01 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdk.c: move prototype of gdk_wm_protocols_filter outside
+       of the USE_XIM #ifdef
+
+       * gtk/Makefile.am: cause the built sources to be rebuild when possible,
+        even with --include-deps. Slightly different from timj's fix, to avoid
+       circular dependency with gtkmarshal.c
+
+       * autogen.sh
+       * gtk/gtkclist.[ch]
+       * gtk/gtkctree.c
+       * gtk/gtkfontsel.[ch]
+       * gtk/gtklist.c
+       * gtk/gtklistitem.c
+       * gtk/gtkobject.[ch]
+       * gtk/testgtk.c: merges from HEAD
+
+       * gtk/gtkmenubar.c
+       * gtk/gtkradiomenuitem.c
+       * gtk/gtktreeitem.c: cleanups
+
+Wed Oct 28 23:32:19 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdkrgb.c: Oops. s/BIGENDIAN/BIG_ENDIAN/
+
+Wed Oct 28 19:04:49 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * configure.in: AIX has libpthreads, to make sure you can have
+       more than one thread. Also add -D_THREAD_SAFE, and reorder
+       configure.in so CFLAGS doesn't get clobbered when we actually
+       want to modify it
+
+       * gdk/gdkimage.c: initialize the bpp and byte_order fields properly
+       in gdk_image_get
+
+       * gtk/testdnd.c: removed unused variable "buf"
+
+Mon Oct 26 16:46:15 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkcontainer.c (gtk_container_unregister_toplevel): 
+       remove_link(), not remove()
+
+Thu Oct 22 02:27:30 PDT 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdkrgb.c: use glib endian stuff
+
+       * configure.in: don't need to check for endianness anymore
+
+       * gtk/gtkstyle.h: removed #pragma }, causing a silly warning
+
+Wed Oct 21 17:44:27 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_read_rcfiles): Reset
+       all toplevel widgets, not toplevel windows. (I.e.,
+       plugs should be reset)
+
+       * gtk/gtkwindow.c (gtk_window_read_rcfiles): Yes, we
+       _do_ need to notify the other toplevels - by the time
+       the get the client messages, the RC file dates will
+       have been updated.
+
+       * gtk/gtkcontainer.h: Added a function call to list
+       every toplevel widget.
+
+       * gdk/gdk.c (gdk_event_send_client_message_to_all_recurse): 
+       Don't send client messages to _every_ window on display!
+       
+Tue Oct 20 16:21:04 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkdnd.c (gtk_drag_source_event_cb): Don't start drags 
+       when dragging across widgets, only in drags
+       starting in widget.
+
+Tue Oct 20 15:59:49 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkdnd.c (gtk_drag_source_info_destroy): 
+       Emit "drag_end" signal at end of drag.
+
+Tue Oct 20 13:07:54 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_read_rcfiles): Look
+       for "gtk-embedded" data currently set by 
+       GtkSocket, and use that to forward client message
+       on to embedded windows. Only reset our own toplevel -
+       the others will handle themselves. (Now that
+       GtkMenus live in GtkWindows)
+
+Mon Oct 19 16:40:40 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkdnd.c (get_client_window_at_coords_recurse): Modify
+       client window finding code so that it works with
+       WM's other than fvwm.
+Sun Oct 18 22:48:27 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkdrawwindow.c (gtk_draw_window_get_type): Added
+       the "GtkDrawWindow" class, which is a descendent
+       of the Window class which leaves its background alone.
+       Essentially, a toplevel drawing area, though it does
+       allow adding a child.
+
+Sat Oct 17 00:40:51 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrc.c (gtk_rc_style_init): Duplicate bg_pixmap_name when
+       merging RC styles. Report new share/themes path for
+       themes directory. Deref theme engines when appropriate.
+
+       * gtk/gtkclist.c: Set all backgrounds in _style_set().
+       Make sure that pixel for xor_gc is never 0.
+
+       * gtk/gtkctree.c: Choose colors for plus/minus more
+       carefully, in a hopefully style-independent fashion.
+       (Still needs a bit more work)
+
+       * gtk/gtkwidget.c: Don't send expose events to widgets
+       which are about to be resized and redrawn. (Needs a
+       bit more thought.)
+
+       * gtk/gtknotebook.c (gtk_notebook_draw_tab): Avoid
+       drawing on tabs for newly allocated, un-sized
+       pages - we'll get the size wrong.
+
+Thu Oct  1 17:38:07 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c (gtk_widget_redraw_queue_remove): Fixed
+       up stupidities in last commit.
+
+Thu Oct  1 14:25:43 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c: When handling queued resizes, account
+       for handleboxes, where the widget heirarchy is different
+       than the window heirarchy by just queueing a resize on
+       the entire handlebox if the detached child is changed.
+
+       - Remove widgets from the redraw queue when reparenting,
+       even if not unrealizing. We queue a resize/redraw in
+       any case.
+
+Mon Sep 28 21:07:01 EDT 1998 The Rasterman <raster@redhat.com>
+       * gtk/gtkstyle.c: added check to see if the widget has been shaped
+       byt the app via gtk_widget_shape_combine_mask and if it has does
+       not reset the shape on theme change.
+       
+Tue Sep 15 11:30:03 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkfilesel.c: Keep a list of directories in which we never
+       want to stat the entries (like /afs), and assume everything in
+       those directories is a subdirectory.
+
+       - When following a path, try to open components even when
+       we don't find them in their parent's directory to
+       support automounters.
+
+Fri Sep 11 15:36:33 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully
+       now at least compiles again.
+
+       * gdk/gdk.c (gdk_event_translate): Don't pass events
+       on destroyed widgets to the gdk_input layer.
+
+Thu Sep  3 19:45:34 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkthemes.c: Use g_module instead of dlopen()
+
+Thu Sep  3 19:30:11 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktooltips.c (gtk_tooltips_expose): Check
+       if we've changed widgets since the expose event
+       was queued.
+
+Mon Aug 31 15:33:13 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.h (struct _GtkStyle): Reordered a bit
+       to restore approximate bin compatibility with the
+       non-themes branch. (This does break bin compat
+       within the themes branch.)
+
+Sun Aug 30 16:48:27 1998  Owen Taylor  <otaylor@gtk.org>
+
+       * gtk/gtklabel.c (gtk_label_set): Eliminate a 
+       gdk_window_clear_area() that snuck in with the
+       menu underlines merge.
+
+Mon Aug 24 23:37:26 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktext.c: Fixed some remaining background drawing,
+         merges from main branch, cleanups.
+
+Mon Aug 24 10:55:51 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_draw_tab): Don't
+         dereference NULL focus tab.
+
+       * gtk/gtkscale.c (gtk_scale_[un]map): Add map/unmap
+         functions since we need to both show/hide and 
+         queue a redraw. (There's some duplication of drawing here, 
+         we probably should only be queuing a redraw on the
+         "value" portion of the scale.)
+
+Fri Aug 21 19:02:30 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrange.[ch] gtk/gtkhscale.c gtk/gtkvscale.[ch]: Fit scales
+         into the theme-drawing framework. We do this by making them,
+         like check/radio-buttons, no-window widgets with subwindows. We
+         then move the value by calling gtk_widget_queue_clear() and only
+         redraw the value in our draw() / expose() handler.  A virtual
+         function clear_background is added which queues a clear on the
+         "background" portion of the widget.
+
+Fri Aug 21 13:04:27 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktext.c (mark_bg_gc): Make background colors work
+         again. (We can't always paint the background with a
+         paint() function - only do that for selected text)
+
+Mon Aug 17 20:31:01 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktearoffmenuitem.c gtk/gtkclist.[ch] gtk/gtkctree.[ch]
+         gtk/gtklabel.c gtk/gtkmenu.c: Merges from main branch.
+
+       * Makefile.am (SRC_SUBDIRS): Removed themes from SRC_SUBDIRS.
+         the themes can't be built as part of the same build since
+         they depend on gdk_imlib.
+
+Fri Aug 14 12:44:30 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkthemes.c (gtk_theme_engine_get): Removed sample engine code
+         from gtkthemes.c.
+               
+       * configure.in ltconfig.in ltmain.sh gdk/Makefile.am gtk/Makefile.am
+         gtk/
+
+         - Upgrade to libtool-1.2b + patch to add shared library dependencies
+           for Linux. (Needs to be extended to other platforms where they
+           are safe)
+
+        - Check for -ldl so this branch should build on all platforms, though
+          themes will work on all platforms they could work on.
+
+        - Use -version and -release simultaneously: sonames stay as they are
+          in the current scheme, but -lgtk-1.1 changes to -lgtk.
+
+        - Added in extra -l flags to library LDFLAGS so we get shared library
+          dependencies against X libs and -ldl. (But not libgtk against 
+          libgdk or libglib yet, since dependencies against uninstalled
+          libraries aren't portable)
+
+Fri Aug 21 16:10:38 EDT 1998 The Rasterman <raster@redhat.com>
+       * gtkrc.c - added api calls to find module and theme paths from gtk.
+         nuked gtk_install_prefix global.
+       
+Fri Aug 21 12:36:46 EDT 1998 The Rasterman <raster@redhat.com>
+       * fixed gtk_install_prefix global.
+         
+Thu Aug 20 19:27:49 EDT 1998 The Rasterman <raster@redhat.com>
+       * added gtk_install_prefix global const variabel to find where gtk is
+         installed.
+         
+Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
+       * added ~/.gtk/lib/themes/engines/ to the default searchpath for
+         gtk theme engines
+       
+Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
+       * made gtkrc scanner append dir that gtkrc is read from to pixmap path.
+
+Mon Aug 10 23:03:55 1998  The Rasterman <raster@redhat.com>
+       * Fixed minor problem in gtkhandlebox.c with drawing, and some
+         notebook stuff. Also pixmap theme is now "clean" again.
+         
+Mon Aug 10 23:03:55 1998  Owen Taylor  <otaylor@redhat.com>
+       * gtk/gtkwidget.c (gtk_widget_clip_rect): Fixed up 
+         queued area resizing once more.
+
+Mon Aug 10 23:09:30 EDT 1998
+       * Added a few drawing fixes for notebook and other widgets. finished
+         pixmap theme up to the level that can be supported so far. (need to
+         add path discovery 9ie where is the rc fiel from - add to pixmap 
+         path so we can get theimages from there too). then we can package 
+         themes. After that need to add to theme seartch path stuff in users 
+         home dir.
+         
+Thu Aug  6 16:49:25 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a
+         drawing area, draw in an expose handler.
+
+       * gtk/gtknotebook.c (gtk_notebook_expose): Check for
+         empty current page.
+
+Wed Aug  5 16:13:15 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved
+         creation of GC's so that they will be set before
+         they are used for map events (why are they used there?)
+
+       * gtk/gtkwidget.c: Fixed mistake that caused widgets to
+         be queued in multiple times in the queue.
+
+Wed Aug  5 14:23:52 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set
+         clip rects (or do anything) for shadow_none.
+
+Wed Aug  5 13:14:57 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkbutton.c (gtk_button_paint): Restored paint function.
+         Yes, it was needed. draw() and expose() are _not_
+         identical.
+
+Sat Aug  1 17:44:31 EDT 1998 EDT 1998 The Rasterman <raster@redhat.com>
+       * Wheeeeeeeeeeeeeeee fixed radiobittons to work in gimp again.
+
+Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
+       * YES YES YES YES YES clist borders work again! YES! YES YES! gimme 
+         more baby oooh yeah more more MORE YES YES.
+
+Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
+       * hopefully fixed problem wiht togglebuttons acting like
+          radiobuttons in gtktogglebutton.c
+
+Thu Jul 30 23:36:46 EDT 1998 The Rasterman <raster@redhat.com>
+       * fixed another drawing buglet in the frame drawing code (actually
+         in the clearing code but anyway in gtkstyle.c)
+
+Thu Jul 30 19:23:48 EDT 1998 The Rasterman <raster@redhat.com>
+       * Fixed warning from colorsel widget...
+
+Thu Jul 30 19:10:42 EDT 1998 The Rasterman <raster@redhat.com>
+       * Fixed defautl drawing code to no longer clobber the original style
+         pixmap bgs as it did and added a helper funciton og gtkstyle.c to
+         help with this.
+
+Thu Jul 30 18:09:21 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrc.c gtk/gtkstyle.c: More mm fixups
+
+       * gtk/gtktooltips.c: Pass a widget (the window) to the
+         drawing function instead of the GtkTooltips.
+
+Thu Jul 30 17:27:10 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkwindow.c: Abstract out checking for shape
+         extension into a function.
+
+       * gtk/gtkwindow.c: Fix up gtk_window_expose()/draw().
+         Remove extra callls to gtk_window_draw().
+
+Thu Jul 30 11:18:43 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.c gtk/gtkrc.c: Memory management fixups.
+
+       * themes/th_main.c: Moved messages around so they are
+         printed before destroying strings.
+
+Wed Jul 29 16:56:07 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdk.c: Fairly simple implementation of expose compression.
+         (No GraphicsExpose compression yet, always compress
+         with the equivalent of XtCompressMultiple - no compression
+         of Expose events across non-Expose events)
+       
+       * gdk/gdk.h gdk/gdkrectangle.c: gdk_rectangle_union()
+         Find rectangle bounding two rectangles.
+
+       * gtk/gtkstyle.c: Set clip rects for a few extra GC's
+         in gdk_default_draw_shadow()
+       
+Wed Jul 29 16:03:20 EDT 1998 The Rasterman <raster@redhat.com>
+       * Fixed drawing functions to handle switching themes on the fly 
+         gracefully and look decent.
+         
+Tue Jul 28 22:52:10 EDT 1998 The Rasterman <raster@redhat.com>
+       * Added all the theme drawing code to all widgets, fixed up minor
+          nigglies in some widgets when it comes to themes, seem to be
+          running into some funky behavior with clipping rects in GC's. Too
+          many files to list here. (all files that now use gtk_paint_* are
+         affected).
+
+Tue Jul 28 22:49:16 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * themes/th_main.c themes/th_draw.c gtk/testgtkrc: 
+         Set up the demo theme so it is loaded from the RC file.
+
+       * themes/th_draw.c: Alleviate the hardcoded paths a wee
+         bit. (use $HOME/themes/)
+
+       * gtk/gtkthemes.[ch] gtk/gtkmain.c: Load engines specified in 
+         the RC file via dlopen()
+
+Tue Jul 28 20:30:56 1998  Owen Taylor  <otaylor@redhat.com>
+
+       Internal handling of styles and RC styles pretty much
+       completely reworked for Theme work.
+
+       * gtkthemes.[ch]: 
+        - Added routines for virtualization of RcStyle and Style handling.
+        - Temporary "sample" inline theme-engine. (Does nothing
+          but print out a few messages.
+       
+       * gtkrc.[ch]
+        - Made GtkRcStyle public, added flags to tell if particular
+          colors have been set.
+        - RC Styles are "transparent", and the final style for
+          a widget is the composition of all matching styles
+        - Added pointer to GtkThemeEngine, and gpointer engine_data
+          to RC style and style.
+        - Parse "engine" keyword, load the appropriate theme engine
+          and call the engine's parser.
+       
+       *  gtkstyle.[ch]
+        - Keep a GtkRcStyle * in styles created from Rc Styles.
+        - Load up images from RC file at style attachment time.
+         - Call ->engine->foo() at appropriate times.
+        - Don't use a GCache. All incarnations for a style are
+          just linked together in a list, depend on the RC style 
+          code to find the existing copy.
+
+Tue Jul 28 14:41:54 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.[ch]: Added the concept of queued redraws
+         of partial areas. This can be done either relative
+         to the existing windows (gtk_widget_queue_clear[_area]())
+         or relative to the future allocation of the widget
+         (gtk_widget_queue_draw[_area]). 
+
+         The initial implementation is pretty braindead, but
+         can be improved.
+
+       * gtk/gtkwidget.[ch]: Removed calls to gdk_window_clear_area()
+         in favor of gtk_widget_queue_clear().
+       
+       * gtk/gtklabel.[ch] gtk/gtkpixmap.[ch]: Removed needs_clear
+         flags in favor of gtk_widget_queue_clear()
+       
+Tue Aug  4 19:12:14 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up
+         handling of partially clipped areas.
+
 Thu Nov  5 18:52:35 1998  Lars Hamann  <lars@gtk.org>
 
        * gtk/gtkclist.h (struct _GtkCListClass)
index 864a7fc11cde495972523895fc15612d45af221f..bf6f251c545cc460beaed3d857d427298393c5e5 100644 (file)
@@ -1,3 +1,544 @@
+Thu Nov  5 12:06:16 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkcheckbutton.c (gtk_check_button_draw_focus): Queue
+       a clear/redraw, not just a redraw, so the focus
+       gets undrawn properly.
+
+       * gtk/gtktogglebutton.c (gtk_toggle_button_unrealize): 
+       Chain to gtk_widget_unrealize() instead of duplicating
+       code.
+
+Wed Nov  4 14:34:51 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdk.c gdk/gdkprivate.h gdk/gdkwindow.c: Removed
+       last vestiges of old DND.
+
+Tue Nov  3 12:27:52 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkentry.c: Restored inner border to entries,
+       erase cursors to background image.
+
+Fri Oct 30 12:09:21 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkentry.c gtk/gtkstyle.[ch]: removed paint_entry() -
+       it was identical to paint_flat_box().
+
+       * gtk/gtkstyle.c: Coding style fixups.
+
+       * gtk/gtkwindow.c (gtk_window_move_resize): removed useless
+       test.
+
+       * gtk/gtkframe.c gtkstyle.[ch] gtknotebook.c: 
+       Change 'side' for paint_[box/shadow]_gap and paint_extension
+       to be GtkPositionType instead of a random int.
+
+       * gtk/gtkaspectframe.c (gtk_aspect_frame_paint): Use 
+       "frame" as detail - an aspectframe should draw identical
+       to a frame.
+
+Tue Oct 27 09:58:11 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkwindow.c (gdk_window_merge_child_shapes): renamed
+       from combine_child_shapes().
+
+       * gdk/gdkwindow.c: Merge propagate_shapes() and
+       propagate_combine_shapes() to remove code duplication.
+
+Thu Nov  5 14:31:57 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdk.c: sometimes we get a KeyRelease before a KeyPress in
+       gdk_event_translate, and the USE_XIM buffer isn't allocated yet.
+       So allocate some mem if it's not already done.
+
+       * clist scrollbar merges from HEAD
+
+Tue Nov  3 13:16:36 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gtk/Makefile.am: remove explict -ldl, gmodule takes care of that
+
+       * gtk/gtkdnd.c: start TARGET_MOTIF_SUCCESS from 0x40000000 instead
+       of 0x80000000, so we stay within the bounds of a postive signed
+       int (it broke some compilers)
+
+       * gtk/gtkmenushell.c
+       * gtk/gtkoptionmenu.c: merges from HEAD to make option menus work
+       when some of the menuitems are hidden
+
+       * gtk/gtkthemes.h: don't include dlfcn.h explictly, gmodule takes
+       care of that
+
+       * gtk/gtkwidget.c: add a dummy continue after the line label
+       next_rect, since some compilers don't like label: }
+
+Sun Nov  1 20:05:55 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * Okay, so we need the X11R6 keysyms so programs don't have to
+       worry about them. They don't conflict anyway. Reverted the #ifdef
+       changes to gtk/*.c
+
+       * gdk/Makefile.am: remove the BUILT_SOURCES rule, and make a
+       special rule for them (X-derived-headers)
+
+Sun Nov  1 05:30:32 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/Makefile.am: changed the awk scripts to generate gdkcursors.h
+       and gdkkeysyms.h into sed scripts, since the awk scripts weren't
+       portable, and we really shouldn't be using awk anyway.
+
+       * makecursors.awk
+       * makekeysyms.awk: bye bye
+
+       * gtk/gtkaccelgroup.c
+       * gtk/gtkclist.c
+       * gtk/gtknotebook.c
+       * gtk/gtkwindow.c: don't use X11R6 keysyms if they aren't there
+
+Sat Oct 31 15:22:14 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/Makefile.am: do the same built sources trick for gdkcursors.h
+       and gdkkeysyms.h. Remove those files from CVS.
+
+Sat Oct 31 14:44:01 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdk.c: move prototype of gdk_wm_protocols_filter outside
+       of the USE_XIM #ifdef
+
+       * gtk/Makefile.am: cause the built sources to be rebuild when possible,
+        even with --include-deps. Slightly different from timj's fix, to avoid
+       circular dependency with gtkmarshal.c
+
+       * autogen.sh
+       * gtk/gtkclist.[ch]
+       * gtk/gtkctree.c
+       * gtk/gtkfontsel.[ch]
+       * gtk/gtklist.c
+       * gtk/gtklistitem.c
+       * gtk/gtkobject.[ch]
+       * gtk/testgtk.c: merges from HEAD
+
+       * gtk/gtkmenubar.c
+       * gtk/gtkradiomenuitem.c
+       * gtk/gtktreeitem.c: cleanups
+
+Wed Oct 28 23:32:19 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdkrgb.c: Oops. s/BIGENDIAN/BIG_ENDIAN/
+
+Wed Oct 28 19:04:49 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * configure.in: AIX has libpthreads, to make sure you can have
+       more than one thread. Also add -D_THREAD_SAFE, and reorder
+       configure.in so CFLAGS doesn't get clobbered when we actually
+       want to modify it
+
+       * gdk/gdkimage.c: initialize the bpp and byte_order fields properly
+       in gdk_image_get
+
+       * gtk/testdnd.c: removed unused variable "buf"
+
+Mon Oct 26 16:46:15 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkcontainer.c (gtk_container_unregister_toplevel): 
+       remove_link(), not remove()
+
+Thu Oct 22 02:27:30 PDT 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdkrgb.c: use glib endian stuff
+
+       * configure.in: don't need to check for endianness anymore
+
+       * gtk/gtkstyle.h: removed #pragma }, causing a silly warning
+
+Wed Oct 21 17:44:27 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_read_rcfiles): Reset
+       all toplevel widgets, not toplevel windows. (I.e.,
+       plugs should be reset)
+
+       * gtk/gtkwindow.c (gtk_window_read_rcfiles): Yes, we
+       _do_ need to notify the other toplevels - by the time
+       the get the client messages, the RC file dates will
+       have been updated.
+
+       * gtk/gtkcontainer.h: Added a function call to list
+       every toplevel widget.
+
+       * gdk/gdk.c (gdk_event_send_client_message_to_all_recurse): 
+       Don't send client messages to _every_ window on display!
+       
+Tue Oct 20 16:21:04 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkdnd.c (gtk_drag_source_event_cb): Don't start drags 
+       when dragging across widgets, only in drags
+       starting in widget.
+
+Tue Oct 20 15:59:49 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkdnd.c (gtk_drag_source_info_destroy): 
+       Emit "drag_end" signal at end of drag.
+
+Tue Oct 20 13:07:54 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_read_rcfiles): Look
+       for "gtk-embedded" data currently set by 
+       GtkSocket, and use that to forward client message
+       on to embedded windows. Only reset our own toplevel -
+       the others will handle themselves. (Now that
+       GtkMenus live in GtkWindows)
+
+Mon Oct 19 16:40:40 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkdnd.c (get_client_window_at_coords_recurse): Modify
+       client window finding code so that it works with
+       WM's other than fvwm.
+Sun Oct 18 22:48:27 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkdrawwindow.c (gtk_draw_window_get_type): Added
+       the "GtkDrawWindow" class, which is a descendent
+       of the Window class which leaves its background alone.
+       Essentially, a toplevel drawing area, though it does
+       allow adding a child.
+
+Sat Oct 17 00:40:51 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrc.c (gtk_rc_style_init): Duplicate bg_pixmap_name when
+       merging RC styles. Report new share/themes path for
+       themes directory. Deref theme engines when appropriate.
+
+       * gtk/gtkclist.c: Set all backgrounds in _style_set().
+       Make sure that pixel for xor_gc is never 0.
+
+       * gtk/gtkctree.c: Choose colors for plus/minus more
+       carefully, in a hopefully style-independent fashion.
+       (Still needs a bit more work)
+
+       * gtk/gtkwidget.c: Don't send expose events to widgets
+       which are about to be resized and redrawn. (Needs a
+       bit more thought.)
+
+       * gtk/gtknotebook.c (gtk_notebook_draw_tab): Avoid
+       drawing on tabs for newly allocated, un-sized
+       pages - we'll get the size wrong.
+
+Thu Oct  1 17:38:07 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c (gtk_widget_redraw_queue_remove): Fixed
+       up stupidities in last commit.
+
+Thu Oct  1 14:25:43 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c: When handling queued resizes, account
+       for handleboxes, where the widget heirarchy is different
+       than the window heirarchy by just queueing a resize on
+       the entire handlebox if the detached child is changed.
+
+       - Remove widgets from the redraw queue when reparenting,
+       even if not unrealizing. We queue a resize/redraw in
+       any case.
+
+Mon Sep 28 21:07:01 EDT 1998 The Rasterman <raster@redhat.com>
+       * gtk/gtkstyle.c: added check to see if the widget has been shaped
+       byt the app via gtk_widget_shape_combine_mask and if it has does
+       not reset the shape on theme change.
+       
+Tue Sep 15 11:30:03 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkfilesel.c: Keep a list of directories in which we never
+       want to stat the entries (like /afs), and assume everything in
+       those directories is a subdirectory.
+
+       - When following a path, try to open components even when
+       we don't find them in their parent's directory to
+       support automounters.
+
+Fri Sep 11 15:36:33 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully
+       now at least compiles again.
+
+       * gdk/gdk.c (gdk_event_translate): Don't pass events
+       on destroyed widgets to the gdk_input layer.
+
+Thu Sep  3 19:45:34 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkthemes.c: Use g_module instead of dlopen()
+
+Thu Sep  3 19:30:11 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktooltips.c (gtk_tooltips_expose): Check
+       if we've changed widgets since the expose event
+       was queued.
+
+Mon Aug 31 15:33:13 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.h (struct _GtkStyle): Reordered a bit
+       to restore approximate bin compatibility with the
+       non-themes branch. (This does break bin compat
+       within the themes branch.)
+
+Sun Aug 30 16:48:27 1998  Owen Taylor  <otaylor@gtk.org>
+
+       * gtk/gtklabel.c (gtk_label_set): Eliminate a 
+       gdk_window_clear_area() that snuck in with the
+       menu underlines merge.
+
+Mon Aug 24 23:37:26 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktext.c: Fixed some remaining background drawing,
+         merges from main branch, cleanups.
+
+Mon Aug 24 10:55:51 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_draw_tab): Don't
+         dereference NULL focus tab.
+
+       * gtk/gtkscale.c (gtk_scale_[un]map): Add map/unmap
+         functions since we need to both show/hide and 
+         queue a redraw. (There's some duplication of drawing here, 
+         we probably should only be queuing a redraw on the
+         "value" portion of the scale.)
+
+Fri Aug 21 19:02:30 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrange.[ch] gtk/gtkhscale.c gtk/gtkvscale.[ch]: Fit scales
+         into the theme-drawing framework. We do this by making them,
+         like check/radio-buttons, no-window widgets with subwindows. We
+         then move the value by calling gtk_widget_queue_clear() and only
+         redraw the value in our draw() / expose() handler.  A virtual
+         function clear_background is added which queues a clear on the
+         "background" portion of the widget.
+
+Fri Aug 21 13:04:27 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktext.c (mark_bg_gc): Make background colors work
+         again. (We can't always paint the background with a
+         paint() function - only do that for selected text)
+
+Mon Aug 17 20:31:01 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktearoffmenuitem.c gtk/gtkclist.[ch] gtk/gtkctree.[ch]
+         gtk/gtklabel.c gtk/gtkmenu.c: Merges from main branch.
+
+       * Makefile.am (SRC_SUBDIRS): Removed themes from SRC_SUBDIRS.
+         the themes can't be built as part of the same build since
+         they depend on gdk_imlib.
+
+Fri Aug 14 12:44:30 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkthemes.c (gtk_theme_engine_get): Removed sample engine code
+         from gtkthemes.c.
+               
+       * configure.in ltconfig.in ltmain.sh gdk/Makefile.am gtk/Makefile.am
+         gtk/
+
+         - Upgrade to libtool-1.2b + patch to add shared library dependencies
+           for Linux. (Needs to be extended to other platforms where they
+           are safe)
+
+        - Check for -ldl so this branch should build on all platforms, though
+          themes will work on all platforms they could work on.
+
+        - Use -version and -release simultaneously: sonames stay as they are
+          in the current scheme, but -lgtk-1.1 changes to -lgtk.
+
+        - Added in extra -l flags to library LDFLAGS so we get shared library
+          dependencies against X libs and -ldl. (But not libgtk against 
+          libgdk or libglib yet, since dependencies against uninstalled
+          libraries aren't portable)
+
+Fri Aug 21 16:10:38 EDT 1998 The Rasterman <raster@redhat.com>
+       * gtkrc.c - added api calls to find module and theme paths from gtk.
+         nuked gtk_install_prefix global.
+       
+Fri Aug 21 12:36:46 EDT 1998 The Rasterman <raster@redhat.com>
+       * fixed gtk_install_prefix global.
+         
+Thu Aug 20 19:27:49 EDT 1998 The Rasterman <raster@redhat.com>
+       * added gtk_install_prefix global const variabel to find where gtk is
+         installed.
+         
+Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
+       * added ~/.gtk/lib/themes/engines/ to the default searchpath for
+         gtk theme engines
+       
+Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
+       * made gtkrc scanner append dir that gtkrc is read from to pixmap path.
+
+Mon Aug 10 23:03:55 1998  The Rasterman <raster@redhat.com>
+       * Fixed minor problem in gtkhandlebox.c with drawing, and some
+         notebook stuff. Also pixmap theme is now "clean" again.
+         
+Mon Aug 10 23:03:55 1998  Owen Taylor  <otaylor@redhat.com>
+       * gtk/gtkwidget.c (gtk_widget_clip_rect): Fixed up 
+         queued area resizing once more.
+
+Mon Aug 10 23:09:30 EDT 1998
+       * Added a few drawing fixes for notebook and other widgets. finished
+         pixmap theme up to the level that can be supported so far. (need to
+         add path discovery 9ie where is the rc fiel from - add to pixmap 
+         path so we can get theimages from there too). then we can package 
+         themes. After that need to add to theme seartch path stuff in users 
+         home dir.
+         
+Thu Aug  6 16:49:25 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a
+         drawing area, draw in an expose handler.
+
+       * gtk/gtknotebook.c (gtk_notebook_expose): Check for
+         empty current page.
+
+Wed Aug  5 16:13:15 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved
+         creation of GC's so that they will be set before
+         they are used for map events (why are they used there?)
+
+       * gtk/gtkwidget.c: Fixed mistake that caused widgets to
+         be queued in multiple times in the queue.
+
+Wed Aug  5 14:23:52 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set
+         clip rects (or do anything) for shadow_none.
+
+Wed Aug  5 13:14:57 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkbutton.c (gtk_button_paint): Restored paint function.
+         Yes, it was needed. draw() and expose() are _not_
+         identical.
+
+Sat Aug  1 17:44:31 EDT 1998 EDT 1998 The Rasterman <raster@redhat.com>
+       * Wheeeeeeeeeeeeeeee fixed radiobittons to work in gimp again.
+
+Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
+       * YES YES YES YES YES clist borders work again! YES! YES YES! gimme 
+         more baby oooh yeah more more MORE YES YES.
+
+Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
+       * hopefully fixed problem wiht togglebuttons acting like
+          radiobuttons in gtktogglebutton.c
+
+Thu Jul 30 23:36:46 EDT 1998 The Rasterman <raster@redhat.com>
+       * fixed another drawing buglet in the frame drawing code (actually
+         in the clearing code but anyway in gtkstyle.c)
+
+Thu Jul 30 19:23:48 EDT 1998 The Rasterman <raster@redhat.com>
+       * Fixed warning from colorsel widget...
+
+Thu Jul 30 19:10:42 EDT 1998 The Rasterman <raster@redhat.com>
+       * Fixed defautl drawing code to no longer clobber the original style
+         pixmap bgs as it did and added a helper funciton og gtkstyle.c to
+         help with this.
+
+Thu Jul 30 18:09:21 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrc.c gtk/gtkstyle.c: More mm fixups
+
+       * gtk/gtktooltips.c: Pass a widget (the window) to the
+         drawing function instead of the GtkTooltips.
+
+Thu Jul 30 17:27:10 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkwindow.c: Abstract out checking for shape
+         extension into a function.
+
+       * gtk/gtkwindow.c: Fix up gtk_window_expose()/draw().
+         Remove extra callls to gtk_window_draw().
+
+Thu Jul 30 11:18:43 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.c gtk/gtkrc.c: Memory management fixups.
+
+       * themes/th_main.c: Moved messages around so they are
+         printed before destroying strings.
+
+Wed Jul 29 16:56:07 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdk.c: Fairly simple implementation of expose compression.
+         (No GraphicsExpose compression yet, always compress
+         with the equivalent of XtCompressMultiple - no compression
+         of Expose events across non-Expose events)
+       
+       * gdk/gdk.h gdk/gdkrectangle.c: gdk_rectangle_union()
+         Find rectangle bounding two rectangles.
+
+       * gtk/gtkstyle.c: Set clip rects for a few extra GC's
+         in gdk_default_draw_shadow()
+       
+Wed Jul 29 16:03:20 EDT 1998 The Rasterman <raster@redhat.com>
+       * Fixed drawing functions to handle switching themes on the fly 
+         gracefully and look decent.
+         
+Tue Jul 28 22:52:10 EDT 1998 The Rasterman <raster@redhat.com>
+       * Added all the theme drawing code to all widgets, fixed up minor
+          nigglies in some widgets when it comes to themes, seem to be
+          running into some funky behavior with clipping rects in GC's. Too
+          many files to list here. (all files that now use gtk_paint_* are
+         affected).
+
+Tue Jul 28 22:49:16 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * themes/th_main.c themes/th_draw.c gtk/testgtkrc: 
+         Set up the demo theme so it is loaded from the RC file.
+
+       * themes/th_draw.c: Alleviate the hardcoded paths a wee
+         bit. (use $HOME/themes/)
+
+       * gtk/gtkthemes.[ch] gtk/gtkmain.c: Load engines specified in 
+         the RC file via dlopen()
+
+Tue Jul 28 20:30:56 1998  Owen Taylor  <otaylor@redhat.com>
+
+       Internal handling of styles and RC styles pretty much
+       completely reworked for Theme work.
+
+       * gtkthemes.[ch]: 
+        - Added routines for virtualization of RcStyle and Style handling.
+        - Temporary "sample" inline theme-engine. (Does nothing
+          but print out a few messages.
+       
+       * gtkrc.[ch]
+        - Made GtkRcStyle public, added flags to tell if particular
+          colors have been set.
+        - RC Styles are "transparent", and the final style for
+          a widget is the composition of all matching styles
+        - Added pointer to GtkThemeEngine, and gpointer engine_data
+          to RC style and style.
+        - Parse "engine" keyword, load the appropriate theme engine
+          and call the engine's parser.
+       
+       *  gtkstyle.[ch]
+        - Keep a GtkRcStyle * in styles created from Rc Styles.
+        - Load up images from RC file at style attachment time.
+         - Call ->engine->foo() at appropriate times.
+        - Don't use a GCache. All incarnations for a style are
+          just linked together in a list, depend on the RC style 
+          code to find the existing copy.
+
+Tue Jul 28 14:41:54 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.[ch]: Added the concept of queued redraws
+         of partial areas. This can be done either relative
+         to the existing windows (gtk_widget_queue_clear[_area]())
+         or relative to the future allocation of the widget
+         (gtk_widget_queue_draw[_area]). 
+
+         The initial implementation is pretty braindead, but
+         can be improved.
+
+       * gtk/gtkwidget.[ch]: Removed calls to gdk_window_clear_area()
+         in favor of gtk_widget_queue_clear().
+       
+       * gtk/gtklabel.[ch] gtk/gtkpixmap.[ch]: Removed needs_clear
+         flags in favor of gtk_widget_queue_clear()
+       
+Tue Aug  4 19:12:14 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up
+         handling of partially clipped areas.
+
 Thu Nov  5 18:52:35 1998  Lars Hamann  <lars@gtk.org>
 
        * gtk/gtkclist.h (struct _GtkCListClass)
index 864a7fc11cde495972523895fc15612d45af221f..bf6f251c545cc460beaed3d857d427298393c5e5 100644 (file)
@@ -1,3 +1,544 @@
+Thu Nov  5 12:06:16 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkcheckbutton.c (gtk_check_button_draw_focus): Queue
+       a clear/redraw, not just a redraw, so the focus
+       gets undrawn properly.
+
+       * gtk/gtktogglebutton.c (gtk_toggle_button_unrealize): 
+       Chain to gtk_widget_unrealize() instead of duplicating
+       code.
+
+Wed Nov  4 14:34:51 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdk.c gdk/gdkprivate.h gdk/gdkwindow.c: Removed
+       last vestiges of old DND.
+
+Tue Nov  3 12:27:52 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkentry.c: Restored inner border to entries,
+       erase cursors to background image.
+
+Fri Oct 30 12:09:21 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkentry.c gtk/gtkstyle.[ch]: removed paint_entry() -
+       it was identical to paint_flat_box().
+
+       * gtk/gtkstyle.c: Coding style fixups.
+
+       * gtk/gtkwindow.c (gtk_window_move_resize): removed useless
+       test.
+
+       * gtk/gtkframe.c gtkstyle.[ch] gtknotebook.c: 
+       Change 'side' for paint_[box/shadow]_gap and paint_extension
+       to be GtkPositionType instead of a random int.
+
+       * gtk/gtkaspectframe.c (gtk_aspect_frame_paint): Use 
+       "frame" as detail - an aspectframe should draw identical
+       to a frame.
+
+Tue Oct 27 09:58:11 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkwindow.c (gdk_window_merge_child_shapes): renamed
+       from combine_child_shapes().
+
+       * gdk/gdkwindow.c: Merge propagate_shapes() and
+       propagate_combine_shapes() to remove code duplication.
+
+Thu Nov  5 14:31:57 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdk.c: sometimes we get a KeyRelease before a KeyPress in
+       gdk_event_translate, and the USE_XIM buffer isn't allocated yet.
+       So allocate some mem if it's not already done.
+
+       * clist scrollbar merges from HEAD
+
+Tue Nov  3 13:16:36 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gtk/Makefile.am: remove explict -ldl, gmodule takes care of that
+
+       * gtk/gtkdnd.c: start TARGET_MOTIF_SUCCESS from 0x40000000 instead
+       of 0x80000000, so we stay within the bounds of a postive signed
+       int (it broke some compilers)
+
+       * gtk/gtkmenushell.c
+       * gtk/gtkoptionmenu.c: merges from HEAD to make option menus work
+       when some of the menuitems are hidden
+
+       * gtk/gtkthemes.h: don't include dlfcn.h explictly, gmodule takes
+       care of that
+
+       * gtk/gtkwidget.c: add a dummy continue after the line label
+       next_rect, since some compilers don't like label: }
+
+Sun Nov  1 20:05:55 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * Okay, so we need the X11R6 keysyms so programs don't have to
+       worry about them. They don't conflict anyway. Reverted the #ifdef
+       changes to gtk/*.c
+
+       * gdk/Makefile.am: remove the BUILT_SOURCES rule, and make a
+       special rule for them (X-derived-headers)
+
+Sun Nov  1 05:30:32 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/Makefile.am: changed the awk scripts to generate gdkcursors.h
+       and gdkkeysyms.h into sed scripts, since the awk scripts weren't
+       portable, and we really shouldn't be using awk anyway.
+
+       * makecursors.awk
+       * makekeysyms.awk: bye bye
+
+       * gtk/gtkaccelgroup.c
+       * gtk/gtkclist.c
+       * gtk/gtknotebook.c
+       * gtk/gtkwindow.c: don't use X11R6 keysyms if they aren't there
+
+Sat Oct 31 15:22:14 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/Makefile.am: do the same built sources trick for gdkcursors.h
+       and gdkkeysyms.h. Remove those files from CVS.
+
+Sat Oct 31 14:44:01 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdk.c: move prototype of gdk_wm_protocols_filter outside
+       of the USE_XIM #ifdef
+
+       * gtk/Makefile.am: cause the built sources to be rebuild when possible,
+        even with --include-deps. Slightly different from timj's fix, to avoid
+       circular dependency with gtkmarshal.c
+
+       * autogen.sh
+       * gtk/gtkclist.[ch]
+       * gtk/gtkctree.c
+       * gtk/gtkfontsel.[ch]
+       * gtk/gtklist.c
+       * gtk/gtklistitem.c
+       * gtk/gtkobject.[ch]
+       * gtk/testgtk.c: merges from HEAD
+
+       * gtk/gtkmenubar.c
+       * gtk/gtkradiomenuitem.c
+       * gtk/gtktreeitem.c: cleanups
+
+Wed Oct 28 23:32:19 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdkrgb.c: Oops. s/BIGENDIAN/BIG_ENDIAN/
+
+Wed Oct 28 19:04:49 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * configure.in: AIX has libpthreads, to make sure you can have
+       more than one thread. Also add -D_THREAD_SAFE, and reorder
+       configure.in so CFLAGS doesn't get clobbered when we actually
+       want to modify it
+
+       * gdk/gdkimage.c: initialize the bpp and byte_order fields properly
+       in gdk_image_get
+
+       * gtk/testdnd.c: removed unused variable "buf"
+
+Mon Oct 26 16:46:15 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkcontainer.c (gtk_container_unregister_toplevel): 
+       remove_link(), not remove()
+
+Thu Oct 22 02:27:30 PDT 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdkrgb.c: use glib endian stuff
+
+       * configure.in: don't need to check for endianness anymore
+
+       * gtk/gtkstyle.h: removed #pragma }, causing a silly warning
+
+Wed Oct 21 17:44:27 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_read_rcfiles): Reset
+       all toplevel widgets, not toplevel windows. (I.e.,
+       plugs should be reset)
+
+       * gtk/gtkwindow.c (gtk_window_read_rcfiles): Yes, we
+       _do_ need to notify the other toplevels - by the time
+       the get the client messages, the RC file dates will
+       have been updated.
+
+       * gtk/gtkcontainer.h: Added a function call to list
+       every toplevel widget.
+
+       * gdk/gdk.c (gdk_event_send_client_message_to_all_recurse): 
+       Don't send client messages to _every_ window on display!
+       
+Tue Oct 20 16:21:04 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkdnd.c (gtk_drag_source_event_cb): Don't start drags 
+       when dragging across widgets, only in drags
+       starting in widget.
+
+Tue Oct 20 15:59:49 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkdnd.c (gtk_drag_source_info_destroy): 
+       Emit "drag_end" signal at end of drag.
+
+Tue Oct 20 13:07:54 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_read_rcfiles): Look
+       for "gtk-embedded" data currently set by 
+       GtkSocket, and use that to forward client message
+       on to embedded windows. Only reset our own toplevel -
+       the others will handle themselves. (Now that
+       GtkMenus live in GtkWindows)
+
+Mon Oct 19 16:40:40 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkdnd.c (get_client_window_at_coords_recurse): Modify
+       client window finding code so that it works with
+       WM's other than fvwm.
+Sun Oct 18 22:48:27 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkdrawwindow.c (gtk_draw_window_get_type): Added
+       the "GtkDrawWindow" class, which is a descendent
+       of the Window class which leaves its background alone.
+       Essentially, a toplevel drawing area, though it does
+       allow adding a child.
+
+Sat Oct 17 00:40:51 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrc.c (gtk_rc_style_init): Duplicate bg_pixmap_name when
+       merging RC styles. Report new share/themes path for
+       themes directory. Deref theme engines when appropriate.
+
+       * gtk/gtkclist.c: Set all backgrounds in _style_set().
+       Make sure that pixel for xor_gc is never 0.
+
+       * gtk/gtkctree.c: Choose colors for plus/minus more
+       carefully, in a hopefully style-independent fashion.
+       (Still needs a bit more work)
+
+       * gtk/gtkwidget.c: Don't send expose events to widgets
+       which are about to be resized and redrawn. (Needs a
+       bit more thought.)
+
+       * gtk/gtknotebook.c (gtk_notebook_draw_tab): Avoid
+       drawing on tabs for newly allocated, un-sized
+       pages - we'll get the size wrong.
+
+Thu Oct  1 17:38:07 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c (gtk_widget_redraw_queue_remove): Fixed
+       up stupidities in last commit.
+
+Thu Oct  1 14:25:43 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c: When handling queued resizes, account
+       for handleboxes, where the widget heirarchy is different
+       than the window heirarchy by just queueing a resize on
+       the entire handlebox if the detached child is changed.
+
+       - Remove widgets from the redraw queue when reparenting,
+       even if not unrealizing. We queue a resize/redraw in
+       any case.
+
+Mon Sep 28 21:07:01 EDT 1998 The Rasterman <raster@redhat.com>
+       * gtk/gtkstyle.c: added check to see if the widget has been shaped
+       byt the app via gtk_widget_shape_combine_mask and if it has does
+       not reset the shape on theme change.
+       
+Tue Sep 15 11:30:03 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkfilesel.c: Keep a list of directories in which we never
+       want to stat the entries (like /afs), and assume everything in
+       those directories is a subdirectory.
+
+       - When following a path, try to open components even when
+       we don't find them in their parent's directory to
+       support automounters.
+
+Fri Sep 11 15:36:33 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully
+       now at least compiles again.
+
+       * gdk/gdk.c (gdk_event_translate): Don't pass events
+       on destroyed widgets to the gdk_input layer.
+
+Thu Sep  3 19:45:34 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkthemes.c: Use g_module instead of dlopen()
+
+Thu Sep  3 19:30:11 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktooltips.c (gtk_tooltips_expose): Check
+       if we've changed widgets since the expose event
+       was queued.
+
+Mon Aug 31 15:33:13 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.h (struct _GtkStyle): Reordered a bit
+       to restore approximate bin compatibility with the
+       non-themes branch. (This does break bin compat
+       within the themes branch.)
+
+Sun Aug 30 16:48:27 1998  Owen Taylor  <otaylor@gtk.org>
+
+       * gtk/gtklabel.c (gtk_label_set): Eliminate a 
+       gdk_window_clear_area() that snuck in with the
+       menu underlines merge.
+
+Mon Aug 24 23:37:26 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktext.c: Fixed some remaining background drawing,
+         merges from main branch, cleanups.
+
+Mon Aug 24 10:55:51 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_draw_tab): Don't
+         dereference NULL focus tab.
+
+       * gtk/gtkscale.c (gtk_scale_[un]map): Add map/unmap
+         functions since we need to both show/hide and 
+         queue a redraw. (There's some duplication of drawing here, 
+         we probably should only be queuing a redraw on the
+         "value" portion of the scale.)
+
+Fri Aug 21 19:02:30 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrange.[ch] gtk/gtkhscale.c gtk/gtkvscale.[ch]: Fit scales
+         into the theme-drawing framework. We do this by making them,
+         like check/radio-buttons, no-window widgets with subwindows. We
+         then move the value by calling gtk_widget_queue_clear() and only
+         redraw the value in our draw() / expose() handler.  A virtual
+         function clear_background is added which queues a clear on the
+         "background" portion of the widget.
+
+Fri Aug 21 13:04:27 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktext.c (mark_bg_gc): Make background colors work
+         again. (We can't always paint the background with a
+         paint() function - only do that for selected text)
+
+Mon Aug 17 20:31:01 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktearoffmenuitem.c gtk/gtkclist.[ch] gtk/gtkctree.[ch]
+         gtk/gtklabel.c gtk/gtkmenu.c: Merges from main branch.
+
+       * Makefile.am (SRC_SUBDIRS): Removed themes from SRC_SUBDIRS.
+         the themes can't be built as part of the same build since
+         they depend on gdk_imlib.
+
+Fri Aug 14 12:44:30 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkthemes.c (gtk_theme_engine_get): Removed sample engine code
+         from gtkthemes.c.
+               
+       * configure.in ltconfig.in ltmain.sh gdk/Makefile.am gtk/Makefile.am
+         gtk/
+
+         - Upgrade to libtool-1.2b + patch to add shared library dependencies
+           for Linux. (Needs to be extended to other platforms where they
+           are safe)
+
+        - Check for -ldl so this branch should build on all platforms, though
+          themes will work on all platforms they could work on.
+
+        - Use -version and -release simultaneously: sonames stay as they are
+          in the current scheme, but -lgtk-1.1 changes to -lgtk.
+
+        - Added in extra -l flags to library LDFLAGS so we get shared library
+          dependencies against X libs and -ldl. (But not libgtk against 
+          libgdk or libglib yet, since dependencies against uninstalled
+          libraries aren't portable)
+
+Fri Aug 21 16:10:38 EDT 1998 The Rasterman <raster@redhat.com>
+       * gtkrc.c - added api calls to find module and theme paths from gtk.
+         nuked gtk_install_prefix global.
+       
+Fri Aug 21 12:36:46 EDT 1998 The Rasterman <raster@redhat.com>
+       * fixed gtk_install_prefix global.
+         
+Thu Aug 20 19:27:49 EDT 1998 The Rasterman <raster@redhat.com>
+       * added gtk_install_prefix global const variabel to find where gtk is
+         installed.
+         
+Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
+       * added ~/.gtk/lib/themes/engines/ to the default searchpath for
+         gtk theme engines
+       
+Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
+       * made gtkrc scanner append dir that gtkrc is read from to pixmap path.
+
+Mon Aug 10 23:03:55 1998  The Rasterman <raster@redhat.com>
+       * Fixed minor problem in gtkhandlebox.c with drawing, and some
+         notebook stuff. Also pixmap theme is now "clean" again.
+         
+Mon Aug 10 23:03:55 1998  Owen Taylor  <otaylor@redhat.com>
+       * gtk/gtkwidget.c (gtk_widget_clip_rect): Fixed up 
+         queued area resizing once more.
+
+Mon Aug 10 23:09:30 EDT 1998
+       * Added a few drawing fixes for notebook and other widgets. finished
+         pixmap theme up to the level that can be supported so far. (need to
+         add path discovery 9ie where is the rc fiel from - add to pixmap 
+         path so we can get theimages from there too). then we can package 
+         themes. After that need to add to theme seartch path stuff in users 
+         home dir.
+         
+Thu Aug  6 16:49:25 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a
+         drawing area, draw in an expose handler.
+
+       * gtk/gtknotebook.c (gtk_notebook_expose): Check for
+         empty current page.
+
+Wed Aug  5 16:13:15 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved
+         creation of GC's so that they will be set before
+         they are used for map events (why are they used there?)
+
+       * gtk/gtkwidget.c: Fixed mistake that caused widgets to
+         be queued in multiple times in the queue.
+
+Wed Aug  5 14:23:52 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set
+         clip rects (or do anything) for shadow_none.
+
+Wed Aug  5 13:14:57 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkbutton.c (gtk_button_paint): Restored paint function.
+         Yes, it was needed. draw() and expose() are _not_
+         identical.
+
+Sat Aug  1 17:44:31 EDT 1998 EDT 1998 The Rasterman <raster@redhat.com>
+       * Wheeeeeeeeeeeeeeee fixed radiobittons to work in gimp again.
+
+Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
+       * YES YES YES YES YES clist borders work again! YES! YES YES! gimme 
+         more baby oooh yeah more more MORE YES YES.
+
+Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
+       * hopefully fixed problem wiht togglebuttons acting like
+          radiobuttons in gtktogglebutton.c
+
+Thu Jul 30 23:36:46 EDT 1998 The Rasterman <raster@redhat.com>
+       * fixed another drawing buglet in the frame drawing code (actually
+         in the clearing code but anyway in gtkstyle.c)
+
+Thu Jul 30 19:23:48 EDT 1998 The Rasterman <raster@redhat.com>
+       * Fixed warning from colorsel widget...
+
+Thu Jul 30 19:10:42 EDT 1998 The Rasterman <raster@redhat.com>
+       * Fixed defautl drawing code to no longer clobber the original style
+         pixmap bgs as it did and added a helper funciton og gtkstyle.c to
+         help with this.
+
+Thu Jul 30 18:09:21 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrc.c gtk/gtkstyle.c: More mm fixups
+
+       * gtk/gtktooltips.c: Pass a widget (the window) to the
+         drawing function instead of the GtkTooltips.
+
+Thu Jul 30 17:27:10 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkwindow.c: Abstract out checking for shape
+         extension into a function.
+
+       * gtk/gtkwindow.c: Fix up gtk_window_expose()/draw().
+         Remove extra callls to gtk_window_draw().
+
+Thu Jul 30 11:18:43 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.c gtk/gtkrc.c: Memory management fixups.
+
+       * themes/th_main.c: Moved messages around so they are
+         printed before destroying strings.
+
+Wed Jul 29 16:56:07 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdk.c: Fairly simple implementation of expose compression.
+         (No GraphicsExpose compression yet, always compress
+         with the equivalent of XtCompressMultiple - no compression
+         of Expose events across non-Expose events)
+       
+       * gdk/gdk.h gdk/gdkrectangle.c: gdk_rectangle_union()
+         Find rectangle bounding two rectangles.
+
+       * gtk/gtkstyle.c: Set clip rects for a few extra GC's
+         in gdk_default_draw_shadow()
+       
+Wed Jul 29 16:03:20 EDT 1998 The Rasterman <raster@redhat.com>
+       * Fixed drawing functions to handle switching themes on the fly 
+         gracefully and look decent.
+         
+Tue Jul 28 22:52:10 EDT 1998 The Rasterman <raster@redhat.com>
+       * Added all the theme drawing code to all widgets, fixed up minor
+          nigglies in some widgets when it comes to themes, seem to be
+          running into some funky behavior with clipping rects in GC's. Too
+          many files to list here. (all files that now use gtk_paint_* are
+         affected).
+
+Tue Jul 28 22:49:16 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * themes/th_main.c themes/th_draw.c gtk/testgtkrc: 
+         Set up the demo theme so it is loaded from the RC file.
+
+       * themes/th_draw.c: Alleviate the hardcoded paths a wee
+         bit. (use $HOME/themes/)
+
+       * gtk/gtkthemes.[ch] gtk/gtkmain.c: Load engines specified in 
+         the RC file via dlopen()
+
+Tue Jul 28 20:30:56 1998  Owen Taylor  <otaylor@redhat.com>
+
+       Internal handling of styles and RC styles pretty much
+       completely reworked for Theme work.
+
+       * gtkthemes.[ch]: 
+        - Added routines for virtualization of RcStyle and Style handling.
+        - Temporary "sample" inline theme-engine. (Does nothing
+          but print out a few messages.
+       
+       * gtkrc.[ch]
+        - Made GtkRcStyle public, added flags to tell if particular
+          colors have been set.
+        - RC Styles are "transparent", and the final style for
+          a widget is the composition of all matching styles
+        - Added pointer to GtkThemeEngine, and gpointer engine_data
+          to RC style and style.
+        - Parse "engine" keyword, load the appropriate theme engine
+          and call the engine's parser.
+       
+       *  gtkstyle.[ch]
+        - Keep a GtkRcStyle * in styles created from Rc Styles.
+        - Load up images from RC file at style attachment time.
+         - Call ->engine->foo() at appropriate times.
+        - Don't use a GCache. All incarnations for a style are
+          just linked together in a list, depend on the RC style 
+          code to find the existing copy.
+
+Tue Jul 28 14:41:54 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.[ch]: Added the concept of queued redraws
+         of partial areas. This can be done either relative
+         to the existing windows (gtk_widget_queue_clear[_area]())
+         or relative to the future allocation of the widget
+         (gtk_widget_queue_draw[_area]). 
+
+         The initial implementation is pretty braindead, but
+         can be improved.
+
+       * gtk/gtkwidget.[ch]: Removed calls to gdk_window_clear_area()
+         in favor of gtk_widget_queue_clear().
+       
+       * gtk/gtklabel.[ch] gtk/gtkpixmap.[ch]: Removed needs_clear
+         flags in favor of gtk_widget_queue_clear()
+       
+Tue Aug  4 19:12:14 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up
+         handling of partially clipped areas.
+
 Thu Nov  5 18:52:35 1998  Lars Hamann  <lars@gtk.org>
 
        * gtk/gtkclist.h (struct _GtkCListClass)
index 864a7fc11cde495972523895fc15612d45af221f..bf6f251c545cc460beaed3d857d427298393c5e5 100644 (file)
@@ -1,3 +1,544 @@
+Thu Nov  5 12:06:16 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkcheckbutton.c (gtk_check_button_draw_focus): Queue
+       a clear/redraw, not just a redraw, so the focus
+       gets undrawn properly.
+
+       * gtk/gtktogglebutton.c (gtk_toggle_button_unrealize): 
+       Chain to gtk_widget_unrealize() instead of duplicating
+       code.
+
+Wed Nov  4 14:34:51 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdk.c gdk/gdkprivate.h gdk/gdkwindow.c: Removed
+       last vestiges of old DND.
+
+Tue Nov  3 12:27:52 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkentry.c: Restored inner border to entries,
+       erase cursors to background image.
+
+Fri Oct 30 12:09:21 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkentry.c gtk/gtkstyle.[ch]: removed paint_entry() -
+       it was identical to paint_flat_box().
+
+       * gtk/gtkstyle.c: Coding style fixups.
+
+       * gtk/gtkwindow.c (gtk_window_move_resize): removed useless
+       test.
+
+       * gtk/gtkframe.c gtkstyle.[ch] gtknotebook.c: 
+       Change 'side' for paint_[box/shadow]_gap and paint_extension
+       to be GtkPositionType instead of a random int.
+
+       * gtk/gtkaspectframe.c (gtk_aspect_frame_paint): Use 
+       "frame" as detail - an aspectframe should draw identical
+       to a frame.
+
+Tue Oct 27 09:58:11 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkwindow.c (gdk_window_merge_child_shapes): renamed
+       from combine_child_shapes().
+
+       * gdk/gdkwindow.c: Merge propagate_shapes() and
+       propagate_combine_shapes() to remove code duplication.
+
+Thu Nov  5 14:31:57 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdk.c: sometimes we get a KeyRelease before a KeyPress in
+       gdk_event_translate, and the USE_XIM buffer isn't allocated yet.
+       So allocate some mem if it's not already done.
+
+       * clist scrollbar merges from HEAD
+
+Tue Nov  3 13:16:36 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gtk/Makefile.am: remove explict -ldl, gmodule takes care of that
+
+       * gtk/gtkdnd.c: start TARGET_MOTIF_SUCCESS from 0x40000000 instead
+       of 0x80000000, so we stay within the bounds of a postive signed
+       int (it broke some compilers)
+
+       * gtk/gtkmenushell.c
+       * gtk/gtkoptionmenu.c: merges from HEAD to make option menus work
+       when some of the menuitems are hidden
+
+       * gtk/gtkthemes.h: don't include dlfcn.h explictly, gmodule takes
+       care of that
+
+       * gtk/gtkwidget.c: add a dummy continue after the line label
+       next_rect, since some compilers don't like label: }
+
+Sun Nov  1 20:05:55 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * Okay, so we need the X11R6 keysyms so programs don't have to
+       worry about them. They don't conflict anyway. Reverted the #ifdef
+       changes to gtk/*.c
+
+       * gdk/Makefile.am: remove the BUILT_SOURCES rule, and make a
+       special rule for them (X-derived-headers)
+
+Sun Nov  1 05:30:32 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/Makefile.am: changed the awk scripts to generate gdkcursors.h
+       and gdkkeysyms.h into sed scripts, since the awk scripts weren't
+       portable, and we really shouldn't be using awk anyway.
+
+       * makecursors.awk
+       * makekeysyms.awk: bye bye
+
+       * gtk/gtkaccelgroup.c
+       * gtk/gtkclist.c
+       * gtk/gtknotebook.c
+       * gtk/gtkwindow.c: don't use X11R6 keysyms if they aren't there
+
+Sat Oct 31 15:22:14 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/Makefile.am: do the same built sources trick for gdkcursors.h
+       and gdkkeysyms.h. Remove those files from CVS.
+
+Sat Oct 31 14:44:01 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdk.c: move prototype of gdk_wm_protocols_filter outside
+       of the USE_XIM #ifdef
+
+       * gtk/Makefile.am: cause the built sources to be rebuild when possible,
+        even with --include-deps. Slightly different from timj's fix, to avoid
+       circular dependency with gtkmarshal.c
+
+       * autogen.sh
+       * gtk/gtkclist.[ch]
+       * gtk/gtkctree.c
+       * gtk/gtkfontsel.[ch]
+       * gtk/gtklist.c
+       * gtk/gtklistitem.c
+       * gtk/gtkobject.[ch]
+       * gtk/testgtk.c: merges from HEAD
+
+       * gtk/gtkmenubar.c
+       * gtk/gtkradiomenuitem.c
+       * gtk/gtktreeitem.c: cleanups
+
+Wed Oct 28 23:32:19 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdkrgb.c: Oops. s/BIGENDIAN/BIG_ENDIAN/
+
+Wed Oct 28 19:04:49 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * configure.in: AIX has libpthreads, to make sure you can have
+       more than one thread. Also add -D_THREAD_SAFE, and reorder
+       configure.in so CFLAGS doesn't get clobbered when we actually
+       want to modify it
+
+       * gdk/gdkimage.c: initialize the bpp and byte_order fields properly
+       in gdk_image_get
+
+       * gtk/testdnd.c: removed unused variable "buf"
+
+Mon Oct 26 16:46:15 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkcontainer.c (gtk_container_unregister_toplevel): 
+       remove_link(), not remove()
+
+Thu Oct 22 02:27:30 PDT 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdkrgb.c: use glib endian stuff
+
+       * configure.in: don't need to check for endianness anymore
+
+       * gtk/gtkstyle.h: removed #pragma }, causing a silly warning
+
+Wed Oct 21 17:44:27 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_read_rcfiles): Reset
+       all toplevel widgets, not toplevel windows. (I.e.,
+       plugs should be reset)
+
+       * gtk/gtkwindow.c (gtk_window_read_rcfiles): Yes, we
+       _do_ need to notify the other toplevels - by the time
+       the get the client messages, the RC file dates will
+       have been updated.
+
+       * gtk/gtkcontainer.h: Added a function call to list
+       every toplevel widget.
+
+       * gdk/gdk.c (gdk_event_send_client_message_to_all_recurse): 
+       Don't send client messages to _every_ window on display!
+       
+Tue Oct 20 16:21:04 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkdnd.c (gtk_drag_source_event_cb): Don't start drags 
+       when dragging across widgets, only in drags
+       starting in widget.
+
+Tue Oct 20 15:59:49 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkdnd.c (gtk_drag_source_info_destroy): 
+       Emit "drag_end" signal at end of drag.
+
+Tue Oct 20 13:07:54 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_read_rcfiles): Look
+       for "gtk-embedded" data currently set by 
+       GtkSocket, and use that to forward client message
+       on to embedded windows. Only reset our own toplevel -
+       the others will handle themselves. (Now that
+       GtkMenus live in GtkWindows)
+
+Mon Oct 19 16:40:40 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkdnd.c (get_client_window_at_coords_recurse): Modify
+       client window finding code so that it works with
+       WM's other than fvwm.
+Sun Oct 18 22:48:27 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkdrawwindow.c (gtk_draw_window_get_type): Added
+       the "GtkDrawWindow" class, which is a descendent
+       of the Window class which leaves its background alone.
+       Essentially, a toplevel drawing area, though it does
+       allow adding a child.
+
+Sat Oct 17 00:40:51 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrc.c (gtk_rc_style_init): Duplicate bg_pixmap_name when
+       merging RC styles. Report new share/themes path for
+       themes directory. Deref theme engines when appropriate.
+
+       * gtk/gtkclist.c: Set all backgrounds in _style_set().
+       Make sure that pixel for xor_gc is never 0.
+
+       * gtk/gtkctree.c: Choose colors for plus/minus more
+       carefully, in a hopefully style-independent fashion.
+       (Still needs a bit more work)
+
+       * gtk/gtkwidget.c: Don't send expose events to widgets
+       which are about to be resized and redrawn. (Needs a
+       bit more thought.)
+
+       * gtk/gtknotebook.c (gtk_notebook_draw_tab): Avoid
+       drawing on tabs for newly allocated, un-sized
+       pages - we'll get the size wrong.
+
+Thu Oct  1 17:38:07 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c (gtk_widget_redraw_queue_remove): Fixed
+       up stupidities in last commit.
+
+Thu Oct  1 14:25:43 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c: When handling queued resizes, account
+       for handleboxes, where the widget heirarchy is different
+       than the window heirarchy by just queueing a resize on
+       the entire handlebox if the detached child is changed.
+
+       - Remove widgets from the redraw queue when reparenting,
+       even if not unrealizing. We queue a resize/redraw in
+       any case.
+
+Mon Sep 28 21:07:01 EDT 1998 The Rasterman <raster@redhat.com>
+       * gtk/gtkstyle.c: added check to see if the widget has been shaped
+       byt the app via gtk_widget_shape_combine_mask and if it has does
+       not reset the shape on theme change.
+       
+Tue Sep 15 11:30:03 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkfilesel.c: Keep a list of directories in which we never
+       want to stat the entries (like /afs), and assume everything in
+       those directories is a subdirectory.
+
+       - When following a path, try to open components even when
+       we don't find them in their parent's directory to
+       support automounters.
+
+Fri Sep 11 15:36:33 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully
+       now at least compiles again.
+
+       * gdk/gdk.c (gdk_event_translate): Don't pass events
+       on destroyed widgets to the gdk_input layer.
+
+Thu Sep  3 19:45:34 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkthemes.c: Use g_module instead of dlopen()
+
+Thu Sep  3 19:30:11 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktooltips.c (gtk_tooltips_expose): Check
+       if we've changed widgets since the expose event
+       was queued.
+
+Mon Aug 31 15:33:13 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.h (struct _GtkStyle): Reordered a bit
+       to restore approximate bin compatibility with the
+       non-themes branch. (This does break bin compat
+       within the themes branch.)
+
+Sun Aug 30 16:48:27 1998  Owen Taylor  <otaylor@gtk.org>
+
+       * gtk/gtklabel.c (gtk_label_set): Eliminate a 
+       gdk_window_clear_area() that snuck in with the
+       menu underlines merge.
+
+Mon Aug 24 23:37:26 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktext.c: Fixed some remaining background drawing,
+         merges from main branch, cleanups.
+
+Mon Aug 24 10:55:51 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_draw_tab): Don't
+         dereference NULL focus tab.
+
+       * gtk/gtkscale.c (gtk_scale_[un]map): Add map/unmap
+         functions since we need to both show/hide and 
+         queue a redraw. (There's some duplication of drawing here, 
+         we probably should only be queuing a redraw on the
+         "value" portion of the scale.)
+
+Fri Aug 21 19:02:30 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrange.[ch] gtk/gtkhscale.c gtk/gtkvscale.[ch]: Fit scales
+         into the theme-drawing framework. We do this by making them,
+         like check/radio-buttons, no-window widgets with subwindows. We
+         then move the value by calling gtk_widget_queue_clear() and only
+         redraw the value in our draw() / expose() handler.  A virtual
+         function clear_background is added which queues a clear on the
+         "background" portion of the widget.
+
+Fri Aug 21 13:04:27 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktext.c (mark_bg_gc): Make background colors work
+         again. (We can't always paint the background with a
+         paint() function - only do that for selected text)
+
+Mon Aug 17 20:31:01 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktearoffmenuitem.c gtk/gtkclist.[ch] gtk/gtkctree.[ch]
+         gtk/gtklabel.c gtk/gtkmenu.c: Merges from main branch.
+
+       * Makefile.am (SRC_SUBDIRS): Removed themes from SRC_SUBDIRS.
+         the themes can't be built as part of the same build since
+         they depend on gdk_imlib.
+
+Fri Aug 14 12:44:30 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkthemes.c (gtk_theme_engine_get): Removed sample engine code
+         from gtkthemes.c.
+               
+       * configure.in ltconfig.in ltmain.sh gdk/Makefile.am gtk/Makefile.am
+         gtk/
+
+         - Upgrade to libtool-1.2b + patch to add shared library dependencies
+           for Linux. (Needs to be extended to other platforms where they
+           are safe)
+
+        - Check for -ldl so this branch should build on all platforms, though
+          themes will work on all platforms they could work on.
+
+        - Use -version and -release simultaneously: sonames stay as they are
+          in the current scheme, but -lgtk-1.1 changes to -lgtk.
+
+        - Added in extra -l flags to library LDFLAGS so we get shared library
+          dependencies against X libs and -ldl. (But not libgtk against 
+          libgdk or libglib yet, since dependencies against uninstalled
+          libraries aren't portable)
+
+Fri Aug 21 16:10:38 EDT 1998 The Rasterman <raster@redhat.com>
+       * gtkrc.c - added api calls to find module and theme paths from gtk.
+         nuked gtk_install_prefix global.
+       
+Fri Aug 21 12:36:46 EDT 1998 The Rasterman <raster@redhat.com>
+       * fixed gtk_install_prefix global.
+         
+Thu Aug 20 19:27:49 EDT 1998 The Rasterman <raster@redhat.com>
+       * added gtk_install_prefix global const variabel to find where gtk is
+         installed.
+         
+Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
+       * added ~/.gtk/lib/themes/engines/ to the default searchpath for
+         gtk theme engines
+       
+Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
+       * made gtkrc scanner append dir that gtkrc is read from to pixmap path.
+
+Mon Aug 10 23:03:55 1998  The Rasterman <raster@redhat.com>
+       * Fixed minor problem in gtkhandlebox.c with drawing, and some
+         notebook stuff. Also pixmap theme is now "clean" again.
+         
+Mon Aug 10 23:03:55 1998  Owen Taylor  <otaylor@redhat.com>
+       * gtk/gtkwidget.c (gtk_widget_clip_rect): Fixed up 
+         queued area resizing once more.
+
+Mon Aug 10 23:09:30 EDT 1998
+       * Added a few drawing fixes for notebook and other widgets. finished
+         pixmap theme up to the level that can be supported so far. (need to
+         add path discovery 9ie where is the rc fiel from - add to pixmap 
+         path so we can get theimages from there too). then we can package 
+         themes. After that need to add to theme seartch path stuff in users 
+         home dir.
+         
+Thu Aug  6 16:49:25 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a
+         drawing area, draw in an expose handler.
+
+       * gtk/gtknotebook.c (gtk_notebook_expose): Check for
+         empty current page.
+
+Wed Aug  5 16:13:15 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved
+         creation of GC's so that they will be set before
+         they are used for map events (why are they used there?)
+
+       * gtk/gtkwidget.c: Fixed mistake that caused widgets to
+         be queued in multiple times in the queue.
+
+Wed Aug  5 14:23:52 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set
+         clip rects (or do anything) for shadow_none.
+
+Wed Aug  5 13:14:57 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkbutton.c (gtk_button_paint): Restored paint function.
+         Yes, it was needed. draw() and expose() are _not_
+         identical.
+
+Sat Aug  1 17:44:31 EDT 1998 EDT 1998 The Rasterman <raster@redhat.com>
+       * Wheeeeeeeeeeeeeeee fixed radiobittons to work in gimp again.
+
+Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
+       * YES YES YES YES YES clist borders work again! YES! YES YES! gimme 
+         more baby oooh yeah more more MORE YES YES.
+
+Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
+       * hopefully fixed problem wiht togglebuttons acting like
+          radiobuttons in gtktogglebutton.c
+
+Thu Jul 30 23:36:46 EDT 1998 The Rasterman <raster@redhat.com>
+       * fixed another drawing buglet in the frame drawing code (actually
+         in the clearing code but anyway in gtkstyle.c)
+
+Thu Jul 30 19:23:48 EDT 1998 The Rasterman <raster@redhat.com>
+       * Fixed warning from colorsel widget...
+
+Thu Jul 30 19:10:42 EDT 1998 The Rasterman <raster@redhat.com>
+       * Fixed defautl drawing code to no longer clobber the original style
+         pixmap bgs as it did and added a helper funciton og gtkstyle.c to
+         help with this.
+
+Thu Jul 30 18:09:21 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrc.c gtk/gtkstyle.c: More mm fixups
+
+       * gtk/gtktooltips.c: Pass a widget (the window) to the
+         drawing function instead of the GtkTooltips.
+
+Thu Jul 30 17:27:10 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkwindow.c: Abstract out checking for shape
+         extension into a function.
+
+       * gtk/gtkwindow.c: Fix up gtk_window_expose()/draw().
+         Remove extra callls to gtk_window_draw().
+
+Thu Jul 30 11:18:43 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.c gtk/gtkrc.c: Memory management fixups.
+
+       * themes/th_main.c: Moved messages around so they are
+         printed before destroying strings.
+
+Wed Jul 29 16:56:07 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdk.c: Fairly simple implementation of expose compression.
+         (No GraphicsExpose compression yet, always compress
+         with the equivalent of XtCompressMultiple - no compression
+         of Expose events across non-Expose events)
+       
+       * gdk/gdk.h gdk/gdkrectangle.c: gdk_rectangle_union()
+         Find rectangle bounding two rectangles.
+
+       * gtk/gtkstyle.c: Set clip rects for a few extra GC's
+         in gdk_default_draw_shadow()
+       
+Wed Jul 29 16:03:20 EDT 1998 The Rasterman <raster@redhat.com>
+       * Fixed drawing functions to handle switching themes on the fly 
+         gracefully and look decent.
+         
+Tue Jul 28 22:52:10 EDT 1998 The Rasterman <raster@redhat.com>
+       * Added all the theme drawing code to all widgets, fixed up minor
+          nigglies in some widgets when it comes to themes, seem to be
+          running into some funky behavior with clipping rects in GC's. Too
+          many files to list here. (all files that now use gtk_paint_* are
+         affected).
+
+Tue Jul 28 22:49:16 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * themes/th_main.c themes/th_draw.c gtk/testgtkrc: 
+         Set up the demo theme so it is loaded from the RC file.
+
+       * themes/th_draw.c: Alleviate the hardcoded paths a wee
+         bit. (use $HOME/themes/)
+
+       * gtk/gtkthemes.[ch] gtk/gtkmain.c: Load engines specified in 
+         the RC file via dlopen()
+
+Tue Jul 28 20:30:56 1998  Owen Taylor  <otaylor@redhat.com>
+
+       Internal handling of styles and RC styles pretty much
+       completely reworked for Theme work.
+
+       * gtkthemes.[ch]: 
+        - Added routines for virtualization of RcStyle and Style handling.
+        - Temporary "sample" inline theme-engine. (Does nothing
+          but print out a few messages.
+       
+       * gtkrc.[ch]
+        - Made GtkRcStyle public, added flags to tell if particular
+          colors have been set.
+        - RC Styles are "transparent", and the final style for
+          a widget is the composition of all matching styles
+        - Added pointer to GtkThemeEngine, and gpointer engine_data
+          to RC style and style.
+        - Parse "engine" keyword, load the appropriate theme engine
+          and call the engine's parser.
+       
+       *  gtkstyle.[ch]
+        - Keep a GtkRcStyle * in styles created from Rc Styles.
+        - Load up images from RC file at style attachment time.
+         - Call ->engine->foo() at appropriate times.
+        - Don't use a GCache. All incarnations for a style are
+          just linked together in a list, depend on the RC style 
+          code to find the existing copy.
+
+Tue Jul 28 14:41:54 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.[ch]: Added the concept of queued redraws
+         of partial areas. This can be done either relative
+         to the existing windows (gtk_widget_queue_clear[_area]())
+         or relative to the future allocation of the widget
+         (gtk_widget_queue_draw[_area]). 
+
+         The initial implementation is pretty braindead, but
+         can be improved.
+
+       * gtk/gtkwidget.[ch]: Removed calls to gdk_window_clear_area()
+         in favor of gtk_widget_queue_clear().
+       
+       * gtk/gtklabel.[ch] gtk/gtkpixmap.[ch]: Removed needs_clear
+         flags in favor of gtk_widget_queue_clear()
+       
+Tue Aug  4 19:12:14 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up
+         handling of partially clipped areas.
+
 Thu Nov  5 18:52:35 1998  Lars Hamann  <lars@gtk.org>
 
        * gtk/gtkclist.h (struct _GtkCListClass)
index 864a7fc11cde495972523895fc15612d45af221f..bf6f251c545cc460beaed3d857d427298393c5e5 100644 (file)
@@ -1,3 +1,544 @@
+Thu Nov  5 12:06:16 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkcheckbutton.c (gtk_check_button_draw_focus): Queue
+       a clear/redraw, not just a redraw, so the focus
+       gets undrawn properly.
+
+       * gtk/gtktogglebutton.c (gtk_toggle_button_unrealize): 
+       Chain to gtk_widget_unrealize() instead of duplicating
+       code.
+
+Wed Nov  4 14:34:51 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdk.c gdk/gdkprivate.h gdk/gdkwindow.c: Removed
+       last vestiges of old DND.
+
+Tue Nov  3 12:27:52 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkentry.c: Restored inner border to entries,
+       erase cursors to background image.
+
+Fri Oct 30 12:09:21 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkentry.c gtk/gtkstyle.[ch]: removed paint_entry() -
+       it was identical to paint_flat_box().
+
+       * gtk/gtkstyle.c: Coding style fixups.
+
+       * gtk/gtkwindow.c (gtk_window_move_resize): removed useless
+       test.
+
+       * gtk/gtkframe.c gtkstyle.[ch] gtknotebook.c: 
+       Change 'side' for paint_[box/shadow]_gap and paint_extension
+       to be GtkPositionType instead of a random int.
+
+       * gtk/gtkaspectframe.c (gtk_aspect_frame_paint): Use 
+       "frame" as detail - an aspectframe should draw identical
+       to a frame.
+
+Tue Oct 27 09:58:11 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkwindow.c (gdk_window_merge_child_shapes): renamed
+       from combine_child_shapes().
+
+       * gdk/gdkwindow.c: Merge propagate_shapes() and
+       propagate_combine_shapes() to remove code duplication.
+
+Thu Nov  5 14:31:57 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdk.c: sometimes we get a KeyRelease before a KeyPress in
+       gdk_event_translate, and the USE_XIM buffer isn't allocated yet.
+       So allocate some mem if it's not already done.
+
+       * clist scrollbar merges from HEAD
+
+Tue Nov  3 13:16:36 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gtk/Makefile.am: remove explict -ldl, gmodule takes care of that
+
+       * gtk/gtkdnd.c: start TARGET_MOTIF_SUCCESS from 0x40000000 instead
+       of 0x80000000, so we stay within the bounds of a postive signed
+       int (it broke some compilers)
+
+       * gtk/gtkmenushell.c
+       * gtk/gtkoptionmenu.c: merges from HEAD to make option menus work
+       when some of the menuitems are hidden
+
+       * gtk/gtkthemes.h: don't include dlfcn.h explictly, gmodule takes
+       care of that
+
+       * gtk/gtkwidget.c: add a dummy continue after the line label
+       next_rect, since some compilers don't like label: }
+
+Sun Nov  1 20:05:55 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * Okay, so we need the X11R6 keysyms so programs don't have to
+       worry about them. They don't conflict anyway. Reverted the #ifdef
+       changes to gtk/*.c
+
+       * gdk/Makefile.am: remove the BUILT_SOURCES rule, and make a
+       special rule for them (X-derived-headers)
+
+Sun Nov  1 05:30:32 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/Makefile.am: changed the awk scripts to generate gdkcursors.h
+       and gdkkeysyms.h into sed scripts, since the awk scripts weren't
+       portable, and we really shouldn't be using awk anyway.
+
+       * makecursors.awk
+       * makekeysyms.awk: bye bye
+
+       * gtk/gtkaccelgroup.c
+       * gtk/gtkclist.c
+       * gtk/gtknotebook.c
+       * gtk/gtkwindow.c: don't use X11R6 keysyms if they aren't there
+
+Sat Oct 31 15:22:14 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/Makefile.am: do the same built sources trick for gdkcursors.h
+       and gdkkeysyms.h. Remove those files from CVS.
+
+Sat Oct 31 14:44:01 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdk.c: move prototype of gdk_wm_protocols_filter outside
+       of the USE_XIM #ifdef
+
+       * gtk/Makefile.am: cause the built sources to be rebuild when possible,
+        even with --include-deps. Slightly different from timj's fix, to avoid
+       circular dependency with gtkmarshal.c
+
+       * autogen.sh
+       * gtk/gtkclist.[ch]
+       * gtk/gtkctree.c
+       * gtk/gtkfontsel.[ch]
+       * gtk/gtklist.c
+       * gtk/gtklistitem.c
+       * gtk/gtkobject.[ch]
+       * gtk/testgtk.c: merges from HEAD
+
+       * gtk/gtkmenubar.c
+       * gtk/gtkradiomenuitem.c
+       * gtk/gtktreeitem.c: cleanups
+
+Wed Oct 28 23:32:19 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdkrgb.c: Oops. s/BIGENDIAN/BIG_ENDIAN/
+
+Wed Oct 28 19:04:49 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * configure.in: AIX has libpthreads, to make sure you can have
+       more than one thread. Also add -D_THREAD_SAFE, and reorder
+       configure.in so CFLAGS doesn't get clobbered when we actually
+       want to modify it
+
+       * gdk/gdkimage.c: initialize the bpp and byte_order fields properly
+       in gdk_image_get
+
+       * gtk/testdnd.c: removed unused variable "buf"
+
+Mon Oct 26 16:46:15 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkcontainer.c (gtk_container_unregister_toplevel): 
+       remove_link(), not remove()
+
+Thu Oct 22 02:27:30 PDT 1998 Manish Singh <yosh@gimp.org>
+
+       * gdk/gdkrgb.c: use glib endian stuff
+
+       * configure.in: don't need to check for endianness anymore
+
+       * gtk/gtkstyle.h: removed #pragma }, causing a silly warning
+
+Wed Oct 21 17:44:27 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_read_rcfiles): Reset
+       all toplevel widgets, not toplevel windows. (I.e.,
+       plugs should be reset)
+
+       * gtk/gtkwindow.c (gtk_window_read_rcfiles): Yes, we
+       _do_ need to notify the other toplevels - by the time
+       the get the client messages, the RC file dates will
+       have been updated.
+
+       * gtk/gtkcontainer.h: Added a function call to list
+       every toplevel widget.
+
+       * gdk/gdk.c (gdk_event_send_client_message_to_all_recurse): 
+       Don't send client messages to _every_ window on display!
+       
+Tue Oct 20 16:21:04 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkdnd.c (gtk_drag_source_event_cb): Don't start drags 
+       when dragging across widgets, only in drags
+       starting in widget.
+
+Tue Oct 20 15:59:49 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkdnd.c (gtk_drag_source_info_destroy): 
+       Emit "drag_end" signal at end of drag.
+
+Tue Oct 20 13:07:54 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_read_rcfiles): Look
+       for "gtk-embedded" data currently set by 
+       GtkSocket, and use that to forward client message
+       on to embedded windows. Only reset our own toplevel -
+       the others will handle themselves. (Now that
+       GtkMenus live in GtkWindows)
+
+Mon Oct 19 16:40:40 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkdnd.c (get_client_window_at_coords_recurse): Modify
+       client window finding code so that it works with
+       WM's other than fvwm.
+Sun Oct 18 22:48:27 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkdrawwindow.c (gtk_draw_window_get_type): Added
+       the "GtkDrawWindow" class, which is a descendent
+       of the Window class which leaves its background alone.
+       Essentially, a toplevel drawing area, though it does
+       allow adding a child.
+
+Sat Oct 17 00:40:51 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrc.c (gtk_rc_style_init): Duplicate bg_pixmap_name when
+       merging RC styles. Report new share/themes path for
+       themes directory. Deref theme engines when appropriate.
+
+       * gtk/gtkclist.c: Set all backgrounds in _style_set().
+       Make sure that pixel for xor_gc is never 0.
+
+       * gtk/gtkctree.c: Choose colors for plus/minus more
+       carefully, in a hopefully style-independent fashion.
+       (Still needs a bit more work)
+
+       * gtk/gtkwidget.c: Don't send expose events to widgets
+       which are about to be resized and redrawn. (Needs a
+       bit more thought.)
+
+       * gtk/gtknotebook.c (gtk_notebook_draw_tab): Avoid
+       drawing on tabs for newly allocated, un-sized
+       pages - we'll get the size wrong.
+
+Thu Oct  1 17:38:07 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c (gtk_widget_redraw_queue_remove): Fixed
+       up stupidities in last commit.
+
+Thu Oct  1 14:25:43 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c: When handling queued resizes, account
+       for handleboxes, where the widget heirarchy is different
+       than the window heirarchy by just queueing a resize on
+       the entire handlebox if the detached child is changed.
+
+       - Remove widgets from the redraw queue when reparenting,
+       even if not unrealizing. We queue a resize/redraw in
+       any case.
+
+Mon Sep 28 21:07:01 EDT 1998 The Rasterman <raster@redhat.com>
+       * gtk/gtkstyle.c: added check to see if the widget has been shaped
+       byt the app via gtk_widget_shape_combine_mask and if it has does
+       not reset the shape on theme change.
+       
+Tue Sep 15 11:30:03 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkfilesel.c: Keep a list of directories in which we never
+       want to stat the entries (like /afs), and assume everything in
+       those directories is a subdirectory.
+
+       - When following a path, try to open components even when
+       we don't find them in their parent's directory to
+       support automounters.
+
+Fri Sep 11 15:36:33 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully
+       now at least compiles again.
+
+       * gdk/gdk.c (gdk_event_translate): Don't pass events
+       on destroyed widgets to the gdk_input layer.
+
+Thu Sep  3 19:45:34 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkthemes.c: Use g_module instead of dlopen()
+
+Thu Sep  3 19:30:11 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktooltips.c (gtk_tooltips_expose): Check
+       if we've changed widgets since the expose event
+       was queued.
+
+Mon Aug 31 15:33:13 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.h (struct _GtkStyle): Reordered a bit
+       to restore approximate bin compatibility with the
+       non-themes branch. (This does break bin compat
+       within the themes branch.)
+
+Sun Aug 30 16:48:27 1998  Owen Taylor  <otaylor@gtk.org>
+
+       * gtk/gtklabel.c (gtk_label_set): Eliminate a 
+       gdk_window_clear_area() that snuck in with the
+       menu underlines merge.
+
+Mon Aug 24 23:37:26 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktext.c: Fixed some remaining background drawing,
+         merges from main branch, cleanups.
+
+Mon Aug 24 10:55:51 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_draw_tab): Don't
+         dereference NULL focus tab.
+
+       * gtk/gtkscale.c (gtk_scale_[un]map): Add map/unmap
+         functions since we need to both show/hide and 
+         queue a redraw. (There's some duplication of drawing here, 
+         we probably should only be queuing a redraw on the
+         "value" portion of the scale.)
+
+Fri Aug 21 19:02:30 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrange.[ch] gtk/gtkhscale.c gtk/gtkvscale.[ch]: Fit scales
+         into the theme-drawing framework. We do this by making them,
+         like check/radio-buttons, no-window widgets with subwindows. We
+         then move the value by calling gtk_widget_queue_clear() and only
+         redraw the value in our draw() / expose() handler.  A virtual
+         function clear_background is added which queues a clear on the
+         "background" portion of the widget.
+
+Fri Aug 21 13:04:27 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktext.c (mark_bg_gc): Make background colors work
+         again. (We can't always paint the background with a
+         paint() function - only do that for selected text)
+
+Mon Aug 17 20:31:01 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktearoffmenuitem.c gtk/gtkclist.[ch] gtk/gtkctree.[ch]
+         gtk/gtklabel.c gtk/gtkmenu.c: Merges from main branch.
+
+       * Makefile.am (SRC_SUBDIRS): Removed themes from SRC_SUBDIRS.
+         the themes can't be built as part of the same build since
+         they depend on gdk_imlib.
+
+Fri Aug 14 12:44:30 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkthemes.c (gtk_theme_engine_get): Removed sample engine code
+         from gtkthemes.c.
+               
+       * configure.in ltconfig.in ltmain.sh gdk/Makefile.am gtk/Makefile.am
+         gtk/
+
+         - Upgrade to libtool-1.2b + patch to add shared library dependencies
+           for Linux. (Needs to be extended to other platforms where they
+           are safe)
+
+        - Check for -ldl so this branch should build on all platforms, though
+          themes will work on all platforms they could work on.
+
+        - Use -version and -release simultaneously: sonames stay as they are
+          in the current scheme, but -lgtk-1.1 changes to -lgtk.
+
+        - Added in extra -l flags to library LDFLAGS so we get shared library
+          dependencies against X libs and -ldl. (But not libgtk against 
+          libgdk or libglib yet, since dependencies against uninstalled
+          libraries aren't portable)
+
+Fri Aug 21 16:10:38 EDT 1998 The Rasterman <raster@redhat.com>
+       * gtkrc.c - added api calls to find module and theme paths from gtk.
+         nuked gtk_install_prefix global.
+       
+Fri Aug 21 12:36:46 EDT 1998 The Rasterman <raster@redhat.com>
+       * fixed gtk_install_prefix global.
+         
+Thu Aug 20 19:27:49 EDT 1998 The Rasterman <raster@redhat.com>
+       * added gtk_install_prefix global const variabel to find where gtk is
+         installed.
+         
+Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
+       * added ~/.gtk/lib/themes/engines/ to the default searchpath for
+         gtk theme engines
+       
+Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
+       * made gtkrc scanner append dir that gtkrc is read from to pixmap path.
+
+Mon Aug 10 23:03:55 1998  The Rasterman <raster@redhat.com>
+       * Fixed minor problem in gtkhandlebox.c with drawing, and some
+         notebook stuff. Also pixmap theme is now "clean" again.
+         
+Mon Aug 10 23:03:55 1998  Owen Taylor  <otaylor@redhat.com>
+       * gtk/gtkwidget.c (gtk_widget_clip_rect): Fixed up 
+         queued area resizing once more.
+
+Mon Aug 10 23:09:30 EDT 1998
+       * Added a few drawing fixes for notebook and other widgets. finished
+         pixmap theme up to the level that can be supported so far. (need to
+         add path discovery 9ie where is the rc fiel from - add to pixmap 
+         path so we can get theimages from there too). then we can package 
+         themes. After that need to add to theme seartch path stuff in users 
+         home dir.
+         
+Thu Aug  6 16:49:25 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a
+         drawing area, draw in an expose handler.
+
+       * gtk/gtknotebook.c (gtk_notebook_expose): Check for
+         empty current page.
+
+Wed Aug  5 16:13:15 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved
+         creation of GC's so that they will be set before
+         they are used for map events (why are they used there?)
+
+       * gtk/gtkwidget.c: Fixed mistake that caused widgets to
+         be queued in multiple times in the queue.
+
+Wed Aug  5 14:23:52 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set
+         clip rects (or do anything) for shadow_none.
+
+Wed Aug  5 13:14:57 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkbutton.c (gtk_button_paint): Restored paint function.
+         Yes, it was needed. draw() and expose() are _not_
+         identical.
+
+Sat Aug  1 17:44:31 EDT 1998 EDT 1998 The Rasterman <raster@redhat.com>
+       * Wheeeeeeeeeeeeeeee fixed radiobittons to work in gimp again.
+
+Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
+       * YES YES YES YES YES clist borders work again! YES! YES YES! gimme 
+         more baby oooh yeah more more MORE YES YES.
+
+Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
+       * hopefully fixed problem wiht togglebuttons acting like
+          radiobuttons in gtktogglebutton.c
+
+Thu Jul 30 23:36:46 EDT 1998 The Rasterman <raster@redhat.com>
+       * fixed another drawing buglet in the frame drawing code (actually
+         in the clearing code but anyway in gtkstyle.c)
+
+Thu Jul 30 19:23:48 EDT 1998 The Rasterman <raster@redhat.com>
+       * Fixed warning from colorsel widget...
+
+Thu Jul 30 19:10:42 EDT 1998 The Rasterman <raster@redhat.com>
+       * Fixed defautl drawing code to no longer clobber the original style
+         pixmap bgs as it did and added a helper funciton og gtkstyle.c to
+         help with this.
+
+Thu Jul 30 18:09:21 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrc.c gtk/gtkstyle.c: More mm fixups
+
+       * gtk/gtktooltips.c: Pass a widget (the window) to the
+         drawing function instead of the GtkTooltips.
+
+Thu Jul 30 17:27:10 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdkwindow.c: Abstract out checking for shape
+         extension into a function.
+
+       * gtk/gtkwindow.c: Fix up gtk_window_expose()/draw().
+         Remove extra callls to gtk_window_draw().
+
+Thu Jul 30 11:18:43 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.c gtk/gtkrc.c: Memory management fixups.
+
+       * themes/th_main.c: Moved messages around so they are
+         printed before destroying strings.
+
+Wed Jul 29 16:56:07 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdk.c: Fairly simple implementation of expose compression.
+         (No GraphicsExpose compression yet, always compress
+         with the equivalent of XtCompressMultiple - no compression
+         of Expose events across non-Expose events)
+       
+       * gdk/gdk.h gdk/gdkrectangle.c: gdk_rectangle_union()
+         Find rectangle bounding two rectangles.
+
+       * gtk/gtkstyle.c: Set clip rects for a few extra GC's
+         in gdk_default_draw_shadow()
+       
+Wed Jul 29 16:03:20 EDT 1998 The Rasterman <raster@redhat.com>
+       * Fixed drawing functions to handle switching themes on the fly 
+         gracefully and look decent.
+         
+Tue Jul 28 22:52:10 EDT 1998 The Rasterman <raster@redhat.com>
+       * Added all the theme drawing code to all widgets, fixed up minor
+          nigglies in some widgets when it comes to themes, seem to be
+          running into some funky behavior with clipping rects in GC's. Too
+          many files to list here. (all files that now use gtk_paint_* are
+         affected).
+
+Tue Jul 28 22:49:16 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * themes/th_main.c themes/th_draw.c gtk/testgtkrc: 
+         Set up the demo theme so it is loaded from the RC file.
+
+       * themes/th_draw.c: Alleviate the hardcoded paths a wee
+         bit. (use $HOME/themes/)
+
+       * gtk/gtkthemes.[ch] gtk/gtkmain.c: Load engines specified in 
+         the RC file via dlopen()
+
+Tue Jul 28 20:30:56 1998  Owen Taylor  <otaylor@redhat.com>
+
+       Internal handling of styles and RC styles pretty much
+       completely reworked for Theme work.
+
+       * gtkthemes.[ch]: 
+        - Added routines for virtualization of RcStyle and Style handling.
+        - Temporary "sample" inline theme-engine. (Does nothing
+          but print out a few messages.
+       
+       * gtkrc.[ch]
+        - Made GtkRcStyle public, added flags to tell if particular
+          colors have been set.
+        - RC Styles are "transparent", and the final style for
+          a widget is the composition of all matching styles
+        - Added pointer to GtkThemeEngine, and gpointer engine_data
+          to RC style and style.
+        - Parse "engine" keyword, load the appropriate theme engine
+          and call the engine's parser.
+       
+       *  gtkstyle.[ch]
+        - Keep a GtkRcStyle * in styles created from Rc Styles.
+        - Load up images from RC file at style attachment time.
+         - Call ->engine->foo() at appropriate times.
+        - Don't use a GCache. All incarnations for a style are
+          just linked together in a list, depend on the RC style 
+          code to find the existing copy.
+
+Tue Jul 28 14:41:54 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.[ch]: Added the concept of queued redraws
+         of partial areas. This can be done either relative
+         to the existing windows (gtk_widget_queue_clear[_area]())
+         or relative to the future allocation of the widget
+         (gtk_widget_queue_draw[_area]). 
+
+         The initial implementation is pretty braindead, but
+         can be improved.
+
+       * gtk/gtkwidget.[ch]: Removed calls to gdk_window_clear_area()
+         in favor of gtk_widget_queue_clear().
+       
+       * gtk/gtklabel.[ch] gtk/gtkpixmap.[ch]: Removed needs_clear
+         flags in favor of gtk_widget_queue_clear()
+       
+Tue Aug  4 19:12:14 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up
+         handling of partially clipped areas.
+
 Thu Nov  5 18:52:35 1998  Lars Hamann  <lars@gtk.org>
 
        * gtk/gtkclist.h (struct _GtkCListClass)
diff --git a/Makefile.in b/Makefile.in
deleted file mode 100644 (file)
index 6417312..0000000
+++ /dev/null
@@ -1,501 +0,0 @@
-# Makefile.in generated automatically by automake 1.3 from Makefile.am
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-
-DISTDIR =
-
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-
-top_builddir = .
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-host_alias = @host_alias@
-host_triplet = @host@
-CC = @CC@
-GTK_MAJOR_VERSION = @GTK_MAJOR_VERSION@
-GTK_MICRO_VERSION = @GTK_MICRO_VERSION@
-GTK_MINOR_VERSION = @GTK_MINOR_VERSION@
-GTK_VERSION = @GTK_VERSION@
-LD = @LD@
-LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-LT_AGE = @LT_AGE@
-LT_CURRENT = @LT_CURRENT@
-LT_RELEASE = @LT_RELEASE@
-LT_REVISION = @LT_REVISION@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-NM = @NM@
-PACKAGE = @PACKAGE@
-RANLIB = @RANLIB@
-VERSION = @VERSION@
-x_cflags = @x_cflags@
-x_includes = @x_includes@
-x_ldflags = @x_ldflags@
-x_libs = @x_libs@
-xinput_progs = @xinput_progs@
-
-SRC_SUBDIRS = glib gdk gtk
-SUBDIRS = $(SRC_SUBDIRS) docs
-
-bin_SCRIPTS = gtk-config
-
-EXTRA_DIST =   \
-       gtk+.spec       \
-        gtk.m4          \
-       makecopyright   \
-       TODO            \
-       NEWS.pre-1-0    \
-       ChangeLog.pre-1-0       \
-       examples/aspectframe/Makefile  \
-       examples/aspectframe/aspectframe.c  \
-       examples/buttons/Makefile  \
-       examples/buttons/buttons.c  \
-       examples/buttons/info.xpm  \
-       examples/entry/Makefile  \
-       examples/entry/entry.c  \
-       examples/eventbox/Makefile  \
-       examples/eventbox/eventbox.c  \
-       examples/filesel/Makefile  \
-       examples/filesel/filesel.c  \
-       examples/gtkdial/Makefile  \
-       examples/gtkdial/dial_test.c  \
-       examples/gtkdial/gtkdial.c  \
-       examples/gtkdial/gtkdial.h  \
-       examples/helloworld/Makefile  \
-       examples/helloworld/helloworld.c  \
-       examples/helloworld2/Makefile  \
-       examples/helloworld2/helloworld2.c  \
-       examples/list/Makefile  \
-       examples/list/list.c  \
-       examples/menu/Makefile  \
-       examples/menu/menu.c  \
-       examples/menu/menufactory.c  \
-       examples/menu/menufactory.h  \
-       examples/menu/mfmain.c  \
-       examples/menu/mfmain.h  \
-       examples/notebook/Makefile  \
-       examples/notebook/notebook.c  \
-       examples/packbox/Makefile  \
-       examples/packbox/packbox.c  \
-       examples/paned/Makefile  \
-       examples/paned/paned.c  \
-       examples/pixmap/Makefile  \
-       examples/pixmap/pixmap.c  \
-       examples/progressbar/Makefile  \
-       examples/progressbar/progressbar.c  \
-       examples/radiobuttons/Makefile  \
-       examples/radiobuttons/radiobuttons.c  \
-       examples/rulers/Makefile  \
-       examples/rulers/rulers.c  \
-       examples/scribble-simple/Makefile  \
-       examples/scribble-simple/scribble-simple.c  \
-       examples/scrolledwin/Makefile  \
-       examples/scrolledwin/scrolledwin.c  \
-       examples/selection/Makefile  \
-       examples/selection/gettargets.c  \
-       examples/selection/setselection.c  \
-       examples/statusbar/Makefile  \
-       examples/statusbar/statusbar.c  \
-       examples/table/Makefile  \
-       examples/table/table.c  \
-       examples/tictactoe/Makefile  \
-       examples/tictactoe/tictactoe.c  \
-       examples/tictactoe/tictactoe.h  \
-       examples/tictactoe/ttt_test.c  \
-       examples/wheelbarrow/Makefile  \
-       examples/wheelbarrow/wheelbarrow.c  \
-       examples/find-examples.sh
-
-m4datadir = $(datadir)/aclocal
-m4data_DATA = gtk.m4
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES =  gtk-config
-SCRIPTS =  $(bin_SCRIPTS)
-
-DATA =  $(m4data_DATA)
-
-DIST_COMMON =  README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
-Makefile.in NEWS TODO acconfig.h aclocal.m4 config.guess config.h.in \
-config.sub configure configure.in gtk-config.in install-sh ltconfig \
-ltmain.sh missing mkinstalldirs stamp-h.in
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-TAR = tar
-GZIP = --best
-all: all-recursive-am all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
-       cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile
-
-Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
-       cd $(top_builddir) \
-         && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-$(ACLOCAL_M4): @MAINT@ configure.in 
-       cd $(srcdir) && $(ACLOCAL)
-
-config.status: $(srcdir)/configure
-       $(SHELL) ./config.status --recheck
-$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
-       cd $(srcdir) && $(AUTOCONF)
-
-config.h: stamp-h
-       @:
-stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
-       cd $(top_builddir) \
-         && CONFIG_FILES= CONFIG_HEADERS=config.h \
-            $(SHELL) ./config.status
-       @echo timestamp > stamp-h
-$(srcdir)/config.h.in: @MAINT@$(srcdir)/stamp-h.in
-$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
-       cd $(top_srcdir) && $(AUTOHEADER)
-       @echo timestamp > $(srcdir)/stamp-h.in
-
-mostlyclean-hdr:
-
-clean-hdr:
-
-distclean-hdr:
-       -rm -f config.h
-
-maintainer-clean-hdr:
-gtk-config: $(top_builddir)/config.status gtk-config.in
-       cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
-
-install-binSCRIPTS: $(bin_SCRIPTS)
-       @$(NORMAL_INSTALL)
-       $(mkinstalldirs) $(DESTDIR)$(bindir)
-       @list='$(bin_SCRIPTS)'; for p in $$list; do \
-         if test -f $$p; then \
-           echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
-           $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
-         else if test -f $(srcdir)/$$p; then \
-           echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
-           $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
-         else :; fi; fi; \
-       done
-
-uninstall-binSCRIPTS:
-       @$(NORMAL_UNINSTALL)
-       list='$(bin_SCRIPTS)'; for p in $$list; do \
-         rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
-       done
-
-install-m4dataDATA: $(m4data_DATA)
-       @$(NORMAL_INSTALL)
-       $(mkinstalldirs) $(DESTDIR)$(m4datadir)
-       @list='$(m4data_DATA)'; for p in $$list; do \
-         if test -f $(srcdir)/$$p; then \
-           echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(m4datadir)/$$p"; \
-           $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(m4datadir)/$$p; \
-         else if test -f $$p; then \
-           echo " $(INSTALL_DATA) $$p $(DESTDIR)$(m4datadir)/$$p"; \
-           $(INSTALL_DATA) $$p $(DESTDIR)$(m4datadir)/$$p; \
-         fi; fi; \
-       done
-
-uninstall-m4dataDATA:
-       @$(NORMAL_UNINSTALL)
-       list='$(m4data_DATA)'; for p in $$list; do \
-         rm -f $(DESTDIR)$(m4datadir)/$$p; \
-       done
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-
-@SET_MAKE@
-
-all-recursive install-data-recursive install-exec-recursive \
-installdirs-recursive install-recursive uninstall-recursive  \
-check-recursive installcheck-recursive info-recursive dvi-recursive:
-       @set fnord $(MAKEFLAGS); amf=$$2; \
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         target=`echo $@ | sed s/-recursive//`; \
-         echo "Making $$target in $$subdir"; \
-         (cd $$subdir && $(MAKE) $$target) \
-          || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
-       done && test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
-       @set fnord $(MAKEFLAGS); amf=$$2; \
-       rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
-         rev="$$subdir $$rev"; \
-       done; \
-       for subdir in $$rev; do \
-         target=`echo $@ | sed s/-recursive//`; \
-         echo "Making $$target in $$subdir"; \
-         (cd $$subdir && $(MAKE) $$target) \
-          || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
-       done && test -z "$$fail"
-tags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         (cd $$subdir && $(MAKE) tags); \
-       done
-
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP)
-       here=`pwd` && cd $(srcdir) \
-         && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
-       tags=; \
-       here=`pwd`; \
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
-       done; \
-       list='$(SOURCES) $(HEADERS)'; \
-       unique=`for i in $$list; do echo $$i; done | \
-         awk '    { files[$$0] = 1; } \
-              END { for (i in files) print i; }'`; \
-       test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
-         || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
-
-mostlyclean-tags:
-
-clean-tags:
-
-distclean-tags:
-       -rm -f TAGS ID
-
-maintainer-clean-tags:
-
-distdir = $(PACKAGE)-$(VERSION)
-top_distdir = $(distdir)
-
-# This target untars the dist file and tries a VPATH configuration.  Then
-# it guarantees that the distribution is self-contained by making another
-# tarfile.
-distcheck: dist
-       -rm -rf $(distdir)
-       GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
-       mkdir $(distdir)/=build
-       mkdir $(distdir)/=inst
-       dc_install_base=`cd $(distdir)/=inst && pwd`; \
-       cd $(distdir)/=build \
-         && ../configure --srcdir=.. --prefix=$$dc_install_base \
-         && $(MAKE) \
-         && $(MAKE) dvi \
-         && $(MAKE) check \
-         && $(MAKE) install \
-         && $(MAKE) installcheck \
-         && $(MAKE) dist
-       -rm -rf $(distdir)
-       @echo "========================"; \
-       echo "$(distdir).tar.gz is ready for distribution"; \
-       echo "========================"
-dist: distdir
-       -chmod -R a+r $(distdir)
-       GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
-       -rm -rf $(distdir)
-dist-all: distdir
-       -chmod -R a+r $(distdir)
-       GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
-       -rm -rf $(distdir)
-distdir: $(DISTFILES)
-       -rm -rf $(distdir)
-       mkdir $(distdir)
-       -chmod 777 $(distdir)
-       here=`cd $(top_builddir) && pwd`; \
-       top_distdir=`cd $(distdir) && pwd`; \
-       distdir=`cd $(distdir) && pwd`; \
-       cd $(top_srcdir) \
-         && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu Makefile
-       $(mkinstalldirs) $(distdir)/examples $(distdir)/examples/aspectframe \
-          $(distdir)/examples/buttons $(distdir)/examples/entry \
-          $(distdir)/examples/eventbox $(distdir)/examples/filesel \
-          $(distdir)/examples/gtkdial $(distdir)/examples/helloworld \
-          $(distdir)/examples/helloworld2 $(distdir)/examples/list \
-          $(distdir)/examples/menu $(distdir)/examples/notebook \
-          $(distdir)/examples/packbox $(distdir)/examples/paned \
-          $(distdir)/examples/pixmap $(distdir)/examples/progressbar \
-          $(distdir)/examples/radiobuttons $(distdir)/examples/rulers \
-          $(distdir)/examples/scribble-simple \
-          $(distdir)/examples/scrolledwin \
-          $(distdir)/examples/selection $(distdir)/examples/statusbar \
-          $(distdir)/examples/table $(distdir)/examples/tictactoe \
-          $(distdir)/examples/wheelbarrow
-       @for file in $(DISTFILES); do \
-         d=$(srcdir); \
-         test -f $(distdir)/$$file \
-         || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
-         || cp -p $$d/$$file $(distdir)/$$file; \
-       done
-       for subdir in $(SUBDIRS); do \
-         test -d $(distdir)/$$subdir \
-         || mkdir $(distdir)/$$subdir \
-         || exit 1; \
-         chmod 777 $(distdir)/$$subdir; \
-         (cd $$subdir && $(MAKE) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
-           || exit 1; \
-       done
-info: info-recursive
-dvi: dvi-recursive
-check: all-am
-       $(MAKE) check-recursive
-installcheck: installcheck-recursive
-all-recursive-am: config.h
-       $(MAKE) all-recursive
-
-all-am: Makefile $(SCRIPTS) $(DATA) config.h
-
-install-exec-am: install-binSCRIPTS
-
-install-data-am: install-m4dataDATA
-
-uninstall-am: uninstall-binSCRIPTS uninstall-m4dataDATA
-
-install-exec: install-exec-recursive install-exec-am
-       @$(NORMAL_INSTALL)
-
-install-data: install-data-recursive install-data-am
-       @$(NORMAL_INSTALL)
-
-install: install-recursive install-exec-am install-data-am
-       @:
-
-uninstall: uninstall-recursive uninstall-am
-
-install-strip:
-       $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
-installdirs: installdirs-recursive
-       $(mkinstalldirs)  $(DATADIR)$(bindir) $(DATADIR)$(m4datadir)
-
-
-mostlyclean-generic:
-       -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
-
-clean-generic:
-       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
-       -rm -f Makefile $(DISTCLEANFILES)
-       -rm -f config.cache config.log stamp-h stamp-h[0-9]*
-       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
-       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean-am:  mostlyclean-hdr mostlyclean-tags mostlyclean-generic
-
-clean-am:  clean-hdr clean-tags clean-generic mostlyclean-am
-
-distclean-am:  distclean-hdr distclean-tags distclean-generic clean-am
-
-maintainer-clean-am:  maintainer-clean-hdr maintainer-clean-tags \
-               maintainer-clean-generic distclean-am
-
-mostlyclean:  mostlyclean-recursive mostlyclean-am
-
-clean:  clean-recursive clean-am
-
-distclean:  distclean-recursive distclean-am
-       -rm -f config.status
-       -rm -f libtool
-
-maintainer-clean:  maintainer-clean-recursive maintainer-clean-am
-       @echo "This command is intended for maintainers to use;"
-       @echo "it deletes files that may require special tools to rebuild."
-       -rm -f config.status
-
-.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
-uninstall-binSCRIPTS install-binSCRIPTS uninstall-m4dataDATA \
-install-m4dataDATA install-data-recursive uninstall-data-recursive \
-install-exec-recursive uninstall-exec-recursive installdirs-recursive \
-uninstalldirs-recursive all-recursive check-recursive \
-installcheck-recursive info-recursive dvi-recursive \
-mostlyclean-recursive distclean-recursive clean-recursive \
-maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info dvi \
-installcheck all-recursive-am all-am install-exec-am install-data-am \
-uninstall-am install-exec install-data install uninstall all \
-installdirs mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
-
-
-.PHONY: files populate checkin release
-
-files:
-       @files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
-         echo $$p; \
-       done
-       @for subdir in $(SUBDIRS); do \
-         files=`cd $$subdir; $(MAKE) files | grep -v "make\[[1-9]\]"`; \
-         for file in $$files; do \
-           echo $$subdir/$$file; \
-         done; \
-       done
-
-populate:
-       @echo "populating project"
-       @files=`$(MAKE) files | grep -v "make\[[1-9]\]"`; prcs populate -d gtk+.prj $$files
-
-checkin: populate
-       @echo "checking in project"
-       @prcs checkin
-
-release:
-       $(MAKE) dist distdir=$(PACKAGE)`date +"%y%m%d"`
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/TODO b/TODO
index adc029272094f3b03695495efcfea5a988cd4e5c..d59c2ce8a2266b3d58e54b929470f64cbb409b10 100644 (file)
--- a/TODO
+++ b/TODO
@@ -3,10 +3,6 @@ For 1.2.0 release:
        non-functional ones.
        
 Bugs:
- * Widget redrawing when the window resizes sometimes messes up.
-   GtkLabels sometimes redraw without clearing up the underlying background on
-   window resizes.
-
  * Change bitfields to guints from enums, or vice versa?
 
  * MappingNotify events produce warnings.
@@ -17,39 +13,10 @@ Bugs:
    types seperatedly from derived types, so we don't screw foreign
    fundamental types with an already extensively increased seqno.
  
- * Expose events aren't being generated correctly for DND demo
-
- * delay dnd settings to take effect once a widget is realized, this is
-   to avoid force realizations. i think this goes along with owens dnd
-   changes?
-    -timj
-   The way DND data types are set in GtkWidget really needs to be fixed.
-   This is pretty high on my priority list, and I'll get to it as soon as
-   the column list widget is done.  The correct way dnd data needs to be set
-   is to have a additional keyed data type with GtkWidget, which is applied to
-   the widget's window upon realize.
-   There also needs to be a way to set dnd-data on widget windows which are
-   not the main window (for widgets that create more than one window).
-    -Jay Painter
-   DnD seems to work for me, but yes, there needs to be some sort of
-   gtk_widget layer that makes it easier... Also, adding support for drop
-   zones might be nice.
-    -Elliot
-   This one is reproducabel for me:
-   testgtk --sync
-   popup colorselection
-   drag/drop works
-   start up preview color
-   drag works but not dropping
-   end preview color
-   drag/drop works
-   start up prewiev color
-   segfault in malloc
-    -timj
+ * A filter function which destroys the GDK window it is filtering
+   events on is bad news.
 
 Additions:
- * implement keyboard navigation in menus
-
  * focus handling for GtkOptionMenu (needs the previous)
 
  * GScanner: it might be good to ues stdio and getch() instead of 1-character
@@ -282,9 +249,33 @@ Text/Edit widget:
 
   - Delete IC in editable->unrealize, not editable->finalize?
 
+Themes
+======
+
+ - When a scale gets shown/hidden only queue a redraw on the
+   non-window portion, not the whole area.
+
+ - In various places, to avoid shaping windows excessively,
+   we set parent relative backgrounds. This is an ugly
+   hack and needs a better solution. Plus, I don't think
+   these parent-relative backgrounds always persist to
+   when they are actually needed.
+
+   Such calls exist in: GtkButton, GtkHandeBox, GtkItem,
+   GtkListItem, GtkMenu, GtkMenuItem, GtkMisc, 
+   GtkNoteBook, GtkOptionMenu, GtkPaned, GtkPreview,
+   GtkSpinButton and GtkTreeItem.
+
+ - For menus and for GtkWindow's, the realize() function
+   calls paint(), so that background pixmaps can be set
+   ahead of time, and prevent flashing when the window is
+   shown. This is an ugly hack and needs a better solution.
+
+=======
+
 Calendar Widget:
 
- - The widget should be nicely resizeable vertical to.
+ - The widget should be nicely resizeable vertical too.
 
  - CALENDAR_MARGIN should be removed, uses INNER_BORDER and
    style->class->[xy]thickness insted.
@@ -315,3 +306,4 @@ DND
  - Send synthetic motion events on structure changes so 
    drag_enter/leave get sent properly. (See the popup
    in testdnd)
+
index ab9907c618b59aa28fa962a34662ce93a4a7001b..03bb8ec8bab8816f446e12d6feeed7bbc50c4122 100644 (file)
 /* Define if you have the ANSI C header files.  */
 #undef STDC_HEADERS
 
-/* Define if your processor stores words with the most significant
-   byte first (like Motorola and SPARC, unlike Intel and VAX).  */
-#undef WORDS_BIGENDIAN
-
 /* Define if the X Window System is missing or not being used.  */
 #undef X_DISPLAY_MISSING
 
index 88e0ba4f8d0708d140dacfb16b21b35467285086..394fc67c5473d784b0f83ba552d8c31b5a786a95 100644 (file)
@@ -291,11 +291,19 @@ fi
 
 # Threads
 
+CFLAGS="$saved_cflags"
+LDFLAGS="$saved_ldflags"
+
 if test "x$with_threads" = "xposix" || test "x$with_threads" = "xyes"; then
   AC_CHECK_LIB(pthread, pthread_attr_init, 
-    AC_DEFINE(USE_PTHREADS)
+    [AC_DEFINE(USE_PTHREADS)
     x_libs="$x_libs -lpthread"
-    CFLAGS="$CFLAGS -D_REENTRANT") 
+    CFLAGS="$CFLAGS -D_REENTRANT"],
+    # AIX has libpthreads, cause they're special. Special friends (TM)
+    AC_CHECK_LIB(pthreads, pthread_attr_init,
+      [AC_DEFINE(USE_PTHREADS)
+      x_libs="$x_libs -lpthreads"
+      CFLAGS="$CFLAGS -D_REENTRANT -D_THREAD_SAFE"]))
 fi
 
 AC_SUBST(x_cflags)
@@ -304,9 +312,6 @@ AC_SUBST(x_ldflags)
 AC_SUBST(x_libs)
 AC_SUBST(xinput_progs)
 
-CFLAGS="$saved_cflags"
-LDFLAGS="$saved_ldflags"
-
 if test "x$enable_shm" = "xyes"; then
   # Check for shared memory
   AC_CHECK_HEADER(sys/ipc.h, AC_DEFINE(HAVE_IPC_H), no_sys_ipc=yes)
@@ -408,9 +413,6 @@ AC_HEADER_STDC
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 
-# Checks for endianness (needed by GdkRgb).
-AC_C_BIGENDIAN
-
 # Checks for library functions.
 AC_TYPE_SIGNAL
 AC_FUNC_MMAP
index 6cda1761deb84e5578d02b356853f32603b9c04e..6474d6ec9992378a93a021cb0c81a5b342c217ab 100644 (file)
@@ -46,4 +46,19 @@ Incompatible Changes from GTK+-1.0 to GTK+-1.2:
 * The old drag and drop API has been completely removed and replaced.
   See the reference documentation for details on the new API.
 
+* Support for Themes has been added. In general, this does
+  not affect application code, however, a few new rules should
+  be observed:
+
+   - To set a shape for a window, you must use 
+     gtk_widget_shape_combine_mask() instead of 
+     gdk_window_shape_combine_mask(), or the shape will be
+     reset when switching themes.
+
+   - It is no longer permissable to draw directly on an arbitrary
+     widget, or to set an arbitrary widget's background pixmap.
+     If you need to do that, use a GtkDrawingArea or (for a 
+     toplevel) the new GtkDrawWindow widget.
+
+
 
diff --git a/docs/Makefile.in b/docs/Makefile.in
deleted file mode 100644 (file)
index dec979c..0000000
+++ /dev/null
@@ -1,387 +0,0 @@
-# Makefile.in generated automatically by automake 1.3 from Makefile.am
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-
-DISTDIR =
-
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-
-top_builddir = ..
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-host_alias = @host_alias@
-host_triplet = @host@
-CC = @CC@
-GTK_MAJOR_VERSION = @GTK_MAJOR_VERSION@
-GTK_MICRO_VERSION = @GTK_MICRO_VERSION@
-GTK_MINOR_VERSION = @GTK_MINOR_VERSION@
-GTK_VERSION = @GTK_VERSION@
-LD = @LD@
-LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-LT_AGE = @LT_AGE@
-LT_CURRENT = @LT_CURRENT@
-LT_RELEASE = @LT_RELEASE@
-LT_REVISION = @LT_REVISION@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-NM = @NM@
-PACKAGE = @PACKAGE@
-RANLIB = @RANLIB@
-VERSION = @VERSION@
-x_cflags = @x_cflags@
-x_includes = @x_includes@
-x_ldflags = @x_ldflags@
-x_libs = @x_libs@
-xinput_progs = @xinput_progs@
-
-info_TEXINFOS = gdk.texi gtk.texi glib.texi
-
-man_MANS = gtk-config.1
-
-EXTRA_DIST =   \
-       texinfo.tex             \
-       macros.texi             \
-       Makefile.sgml           \
-       gtkdocs_fix             \
-       gtkfaq.sgml             \
-        gtk-config.txt          \
-       gtk_tut.sgml            \
-       gtk_tut_it.sgml         \
-       debugging.txt           \
-       developers.txt          \
-       refcounting.txt         \
-       styles.txt              \
-       text_widget.txt         \
-       widget_system.txt       \
-       gtk_tut_packbox1.gif    \
-       gtk_tut_packbox2.gif    \
-       gtk_tut_table.gif       \
-       gtk-config.1
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = ../config.h
-CONFIG_CLEAN_FILES = 
-TEXI2DVI = texi2dvi
-TEXINFO_TEX = $(srcdir)/texinfo.tex
-INFO_DEPS = gdk.info gtk.info glib.info
-DVIS = gdk.dvi gtk.dvi glib.dvi
-TEXINFOS = gdk.texi gtk.texi glib.texi
-man1dir = $(mandir)/man1
-MANS = $(man_MANS)
-
-NROFF = nroff
-DIST_COMMON =  Makefile.am Makefile.in texinfo.tex
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-TAR = tar
-GZIP = --best
-all: Makefile $(INFO_DEPS) $(MANS)
-
-.SUFFIXES:
-.SUFFIXES: .dvi .info .ps .texi .texinfo .txi
-$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
-       cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile
-
-Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
-       cd $(top_builddir) \
-         && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-
-gdk.info: gdk.texi
-gdk.dvi: gdk.texi
-
-
-gtk.info: gtk.texi
-gtk.dvi: gtk.texi
-
-
-glib.info: glib.texi
-glib.dvi: glib.texi
-
-
-DVIPS = dvips
-
-.texi.info:
-       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
-       cd $(srcdir) \
-         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.texi.dvi:
-       TEXINPUTS=$(srcdir):$$TEXINPUTS \
-         MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
-
-.texi:
-       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
-       cd $(srcdir) \
-         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.texinfo.info:
-       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
-       cd $(srcdir) \
-         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.texinfo:
-       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
-       cd $(srcdir) \
-         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.texinfo.dvi:
-       TEXINPUTS=$(srcdir):$$TEXINPUTS \
-         MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
-
-.txi.info:
-       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
-       cd $(srcdir) \
-         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.txi.dvi:
-       TEXINPUTS=$(srcdir):$$TEXINPUTS \
-         MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
-
-.txi:
-       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
-       cd $(srcdir) \
-         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-.dvi.ps:
-       $(DVIPS) $< -o $@
-
-install-info-am: $(INFO_DEPS)
-       @$(NORMAL_INSTALL)
-       $(mkinstalldirs) $(DESTDIR)$(infodir)
-       @for file in $(INFO_DEPS); do \
-         d=$(srcdir); \
-         for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
-           if test -f $$d/$$ifile; then \
-             echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
-             $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
-           else : ; fi; \
-         done; \
-       done
-       @$(POST_INSTALL)
-       @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
-         for file in $(INFO_DEPS); do \
-           echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
-           install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
-         done; \
-       else : ; fi
-
-uninstall-info:
-       $(PRE_UNINSTALL)
-       @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
-         ii=yes; \
-       else ii=; fi; \
-       for file in $(INFO_DEPS); do \
-         test -z "$ii" \
-           || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
-       done
-       @$(NORMAL_UNINSTALL)
-       for file in $(INFO_DEPS); do \
-         (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
-       done
-
-dist-info: $(INFO_DEPS)
-       for base in $(INFO_DEPS); do \
-         d=$(srcdir); \
-         for file in `cd $$d && eval echo $$base*`; do \
-           test -f $(distdir)/$$file \
-           || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
-           || cp -p $$d/$$file $(distdir)/$$file; \
-         done; \
-       done
-
-mostlyclean-aminfo:
-       -rm -f gdk.aux gdk.cp gdk.cps gdk.dvi gdk.fn gdk.fns gdk.ky gdk.kys \
-         gdk.ps gdk.log gdk.pg gdk.toc gdk.tp gdk.tps gdk.vr gdk.vrs \
-         gdk.op gdk.tr gdk.cv gdk.cn gtk.aux gtk.cp gtk.cps gtk.dvi \
-         gtk.fn gtk.fns gtk.ky gtk.kys gtk.ps gtk.log gtk.pg gtk.toc \
-         gtk.tp gtk.tps gtk.vr gtk.vrs gtk.op gtk.tr gtk.cv gtk.cn \
-         glib.aux glib.cp glib.cps glib.dvi glib.fn glib.fns glib.ky \
-         glib.kys glib.ps glib.log glib.pg glib.toc glib.tp glib.tps \
-         glib.vr glib.vrs glib.op glib.tr glib.cv glib.cn
-
-clean-aminfo:
-
-distclean-aminfo:
-
-maintainer-clean-aminfo:
-       for i in $(INFO_DEPS); do \
-         rm -f $$i; \
-         if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
-           rm -f $$i-[0-9]*; \
-         fi; \
-       done
-
-install-man1:
-       $(mkinstalldirs) $(DESTDIR)$(man1dir)
-       @list='$(man1_MANS)'; \
-       l2='$(man_MANS)'; for i in $$l2; do \
-         case "$$i" in \
-           *.1*) list="$$list $$i" ;; \
-         esac; \
-       done; \
-       for i in $$list; do \
-         if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
-         else file=$$i; fi; \
-         ext=`echo $$i | sed -e 's/^.*\\.//'`; \
-         inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
-         inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-         echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
-         $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
-       done
-
-uninstall-man1:
-       @list='$(man1_MANS)'; \
-       l2='$(man_MANS)'; for i in $$l2; do \
-         case "$$i" in \
-           *.1*) list="$$list $$i" ;; \
-         esac; \
-       done; \
-       for i in $$list; do \
-         ext=`echo $$i | sed -e 's/^.*\\.//'`; \
-         inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
-         inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-         echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
-         rm -f $(DESTDIR)$(man1dir)/$$inst; \
-       done
-install-man: $(MANS)
-       @$(NORMAL_INSTALL)
-       $(MAKE) install-man1
-uninstall-man:
-       @$(NORMAL_UNINSTALL)
-       $(MAKE) uninstall-man1
-tags: TAGS
-TAGS:
-
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-subdir = docs
-
-distdir: $(DISTFILES)
-       here=`cd $(top_builddir) && pwd`; \
-       top_distdir=`cd $(top_distdir) && pwd`; \
-       distdir=`cd $(distdir) && pwd`; \
-       cd $(top_srcdir) \
-         && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu docs/Makefile
-       @for file in $(DISTFILES); do \
-         d=$(srcdir); \
-         test -f $(distdir)/$$file \
-         || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
-         || cp -p $$d/$$file $(distdir)/$$file; \
-       done
-       $(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
-info: $(INFO_DEPS)
-dvi: $(DVIS)
-check: all
-       $(MAKE)
-installcheck:
-install-exec: 
-       @$(NORMAL_INSTALL)
-
-install-data: install-info-am install-man
-       @$(NORMAL_INSTALL)
-
-install: install-exec install-data all
-       @:
-
-uninstall: uninstall-info uninstall-man
-
-install-strip:
-       $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
-installdirs:
-       $(mkinstalldirs)  $(DESTDIR)$(infodir) $(DESTDIR)$(mandir)/man1
-
-
-mostlyclean-generic:
-       -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
-
-clean-generic:
-       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
-       -rm -f Makefile $(DISTCLEANFILES)
-       -rm -f config.cache config.log stamp-h stamp-h[0-9]*
-       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
-       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean:  mostlyclean-aminfo mostlyclean-generic
-
-clean:  clean-aminfo clean-generic mostlyclean
-
-distclean:  distclean-aminfo distclean-generic clean
-       -rm -f config.status
-       -rm -f libtool
-
-maintainer-clean:  maintainer-clean-aminfo maintainer-clean-generic \
-               distclean
-       @echo "This command is intended for maintainers to use;"
-       @echo "it deletes files that may require special tools to rebuild."
-
-.PHONY: install-info-am uninstall-info mostlyclean-aminfo \
-distclean-aminfo clean-aminfo maintainer-clean-aminfo install-man1 \
-uninstall-man1 install-man uninstall-man tags distdir info dvi \
-installcheck install-exec install-data install uninstall all \
-installdirs mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
-
-
-files:
-       @files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
-         echo $$p; \
-       done
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
index 7df5a5d7f87aaf441acf394ecef5b4ef84c31757..e78f2d190d5182a86ad5f8b4b276bc8440d20bd4 100644 (file)
@@ -1,4 +1,3 @@
-
 CC = gcc
 
 filesel: filesel.c 
index b81e7d9aad0573456947c824f7e220f7b55e5971..c9046e29caa426113635f22ce6057ea9743ae985 100644 (file)
@@ -67,15 +67,14 @@ gxid_LDADD = \
        @x_libs@        \
        -lm
 
-BUILT_SOURCES = gdkcursors.h gdkkeysyms.h
-
-EXTRA_DIST = makecursors.awk makekeysyms.awk
-
-gdkcursors.h:
-       awk -f $(srcdir)/makecursors.awk @x_includes@/X11/cursorfont.h > $@
-
-gdkkeysyms.h:
-       awk -f $(srcdir)/makekeysyms.awk @x_includes@/X11/keysymdef.h > $@
+X-derived-headers:
+       sed -e 's/^#define[     ]*XC\([^        ]*\)[   ]*\([^  ]*\)[   ]*.*$$/GDK\1 = \2,/' \
+           -e 'tb' -e 'd' -e ':b' \
+           -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
+           < @x_includes@/X11/cursorfont.h > gdkcursors.h ; \
+       sed -e 's/^#define[     ]*XK\([^        ]*\)[   ]*\([^  ]*\)[   ]*.*$$/#define GDK\1 \2/' \
+           -e 'tb' -e 'd' -e ':b' -e 's/ 0X/ 0x/' \
+           < @x_includes@/X11/keysymdef.h > gdkkeysyms.h
 
 .PHONY: files
 
index 449ad4add8a4e1531f13b7887da64dc0d6650ff1..217724417c9c3bb309eec42894a43eba573bca6b 100644 (file)
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -116,10 +116,6 @@ static Bool         gdk_event_get_type     (Display      *display,
 static void     gdk_synthesize_click   (GdkEvent     *event, 
                                         gint          nclicks);
 
-#ifdef DEBUG_DND
-static void     gdk_print_atom         (GdkAtom       anatom);
-#endif
-
 #ifndef HAVE_XCONVERTCASE
 static void     gdkx_XConvertCase      (KeySym        symbol,
                                         KeySym       *lower,
@@ -156,12 +152,12 @@ static gint   gdk_im_open         (XrmDatabase db,
 static void   gdk_im_close             (void);
 static void   gdk_ic_cleanup           (void);
 
+#endif /* USE_XIM */
+
 GdkFilterReturn gdk_wm_protocols_filter (GdkXEvent *xev,
                                         GdkEvent  *event,
                                         gpointer   data);
 
-#endif /* USE_XIM */
-
 /* Private variable declarations
  */
 static int gdk_initialized = 0;                            /* 1 if the library is initialized,
@@ -743,6 +739,194 @@ gdk_event_get_graphics_expose (GdkWindow *window)
   return NULL; 
 }
 
+/************************
+ * Exposure compression *
+ ************************/
+
+/*
+ * The following implements simple exposure compression. It is
+ * modelled after the way Xt does exposure compression - in
+ * particular compress_expose = XtExposeCompressMultiple.
+ * It compress consecutive sequences of exposure events,
+ * but not sequences that cross other events. (This is because
+ * if it crosses a ConfigureNotify, we could screw up and
+ * mistakenly compress the exposures generated for the new
+ * size - could we just check for ConfigureNotify?)
+ *
+ * Xt compresses to a region / bounding rectangle, we compress
+ * to two rectangles, and try find the two rectangles of minimal
+ * area for this - this is supposed to handle the typical
+ * L-shaped regions generated by OpaqueMove.
+ */
+
+/* Given three rectangles, find the two rectangles that cover
+ * them with the smallest area.
+ */
+static void
+gdk_add_rect_to_rects (GdkRectangle *rect1,
+                      GdkRectangle *rect2, 
+                      GdkRectangle *new_rect)
+{
+  GdkRectangle t1, t2, t3;
+  gint size1, size2, size3;
+
+  gdk_rectangle_union (rect1, rect2, &t1);
+  gdk_rectangle_union (rect1, new_rect, &t2);
+  gdk_rectangle_union (rect2, new_rect, &t3);
+
+  size1 = t1.width * t1.height + new_rect->width * new_rect->height;
+  size2 = t2.width * t2.height + rect2->width * rect2->height;
+  size3 = t1.width * t1.height + rect1->width * rect1->height;
+
+  if (size1 < size2)
+    {
+      if (size1 < size3)
+       {
+         *rect1 = t1;
+         *rect2 = *new_rect;
+       }
+      else
+       *rect2 = t3;
+    }
+  else
+    {
+      if (size2 < size3)
+       *rect1 = t2;
+      else
+       *rect2 = t3;
+    }
+}
+
+typedef struct _GdkExposeInfo GdkExposeInfo;
+
+struct _GdkExposeInfo {
+  Window window;
+  gboolean seen_nonmatching;
+};
+
+Bool
+expose_predicate (Display *display, XEvent *xevent, XPointer arg)
+{
+  GdkExposeInfo *info = (GdkExposeInfo *)arg;
+
+  if (xevent->xany.type != Expose)
+    {
+      info->seen_nonmatching = TRUE;
+    }
+
+  if (info->seen_nonmatching || (xevent->xany.window != info->window))
+    return FALSE;
+  else
+    return TRUE;
+}
+
+void
+gdk_compress_exposures (XEvent *xevent, GdkWindow *window)
+{
+  gint nrects = 1;
+  gint count = 0;
+  GdkRectangle rect1;
+  GdkRectangle rect2;
+  GdkRectangle tmp_rect;
+  XEvent tmp_event;
+  GdkFilterReturn result;
+  GdkExposeInfo info;
+  GdkEvent event;
+
+  info.window = xevent->xany.window;
+  info.seen_nonmatching = FALSE;
+  
+  rect1.x = xevent->xexpose.x;
+  rect1.y = xevent->xexpose.y;
+  rect1.width = xevent->xexpose.width;
+  rect1.height = xevent->xexpose.height;
+
+  while (1)
+    {
+      if (count == 0)
+       {
+         if (!XCheckIfEvent (gdk_display, 
+                             &tmp_event, 
+                             expose_predicate, 
+                             (XPointer)&info))
+           break;
+       }
+      else
+       XIfEvent (gdk_display, 
+                 &tmp_event, 
+                 expose_predicate, 
+                 (XPointer)&info);
+      
+      /* We apply filters here, and if it was filtered, completely
+       * ignore the return
+       */
+      result = gdk_event_apply_filters (xevent, &event,
+                                       window ? 
+                                         ((GdkWindowPrivate *)window)->filters
+                                         : gdk_default_filters);
+      
+      if (result != GDK_FILTER_CONTINUE)
+       {
+         if (result == GDK_FILTER_TRANSLATE)
+           gdk_event_put (&event);
+         continue;
+       }
+
+      if (nrects == 1)
+       {
+         rect2.x = tmp_event.xexpose.x;
+         rect2.y = tmp_event.xexpose.y;
+         rect2.width = tmp_event.xexpose.width;
+         rect2.height = tmp_event.xexpose.height;
+
+         nrects++;
+       }
+      else
+       {
+         tmp_rect.x = tmp_event.xexpose.x;
+         tmp_rect.y = tmp_event.xexpose.y;
+         tmp_rect.width = tmp_event.xexpose.width;
+         tmp_rect.height = tmp_event.xexpose.height;
+
+         gdk_add_rect_to_rects (&rect1, &rect2, &tmp_rect);
+       }
+
+      count = tmp_event.xexpose.count;
+    }
+
+  if (nrects == 2)
+    {
+      gdk_rectangle_union (&rect1, &rect2, &tmp_rect);
+
+      if ((tmp_rect.width * tmp_rect.height) <
+         2 * (rect1.height * rect1.width +
+              rect2.height * rect2.width))
+       {
+         rect1 = tmp_rect;
+         nrects = 1;
+       }
+    }
+
+  if (nrects == 2)
+    {
+      event.expose.type = GDK_EXPOSE;
+      event.expose.window = window;
+      event.expose.area.x = rect2.x;
+      event.expose.area.y = rect2.y;
+      event.expose.area.width = rect2.width;
+      event.expose.area.height = rect2.height;
+      event.expose.count = 0;
+
+      gdk_event_put (&event);
+    }
+
+  xevent->xexpose.count = nrects - 1;
+  xevent->xexpose.x = rect1.x;
+  xevent->xexpose.y = rect1.y;
+  xevent->xexpose.width = rect1.width;
+  xevent->xexpose.height = rect1.height;
+}
+
 /*
  *--------------------------------------------------------------
  * gdk_event_get
@@ -834,6 +1018,7 @@ gdk_event_get (void)
 #else
       XNextEvent (gdk_display, &xevent);
 #endif
+      
       event = gdk_event_new ();
       
       event->any.type = GDK_NOTHING;
@@ -2005,6 +2190,13 @@ gdk_event_translate (GdkEvent *event,
     case KeyRelease:
       /* Lookup the string corresponding to the given keysym.
        */
+#ifdef USE_XIM
+      if (buf_len == 0) 
+       {
+         buf_len = 128;
+         buf = g_new (gchar, buf_len);
+       }
+#endif
       keysym = GDK_VoidSymbol;
       charcount = XLookupString (&xevent->xkey, buf, 16,
                                 &keysym, &compose);
@@ -2031,8 +2223,7 @@ gdk_event_translate (GdkEvent *event,
       /* Print debugging info.
        */
       GDK_NOTE (EVENTS, 
-               g_message ("button press[%d]:\t\twindow: %ld  x,y: %d %d  button: %d",
-                          window_private?window_private->dnd_drag_enabled:0,
+               g_message ("button press:\t\twindow: %ld  x,y: %d %d  button: %d",
                           xevent->xbutton.window - base_id,
                           xevent->xbutton.x, xevent->xbutton.y,
                           xevent->xbutton.button));
@@ -2102,8 +2293,7 @@ gdk_event_translate (GdkEvent *event,
       /* Print debugging info.
        */
       GDK_NOTE (EVENTS, 
-               g_message ("button release[%d]:\twindow: %ld  x,y: %d %d  button: %d",
-                          window_private?window_private->dnd_drag_enabled:0,
+               g_message ("button release:\twindow: %ld  x,y: %d %d  button: %d",
                           xevent->xbutton.window - base_id,
                           xevent->xbutton.x, xevent->xbutton.y,
                           xevent->xbutton.button));
@@ -2178,6 +2368,7 @@ gdk_event_translate (GdkEvent *event,
       
       /* Tell XInput stuff about it if appropriate */
       if (window_private &&
+         !window_private->destroyed &&
          (window_private->extension_events != 0) &&
          gdk_input_vtable.enter_event)
        gdk_input_vtable.enter_event (&xevent->xcrossing, window);
@@ -2357,6 +2548,7 @@ gdk_event_translate (GdkEvent *event,
                           xevent->xexpose.window - base_id, xevent->xexpose.count,
                           xevent->xexpose.x, xevent->xexpose.y,
                           xevent->xexpose.width, xevent->xexpose.height));
+      gdk_compress_exposures (xevent, window);
       
       event->expose.type = GDK_EXPOSE;
       event->expose.window = window;
@@ -2539,10 +2731,11 @@ gdk_event_translate (GdkEvent *event,
                           xevent->xconfigure.above - base_id,
                           xevent->xconfigure.override_redirect));
       
-      if ((window_private->extension_events != 0) &&
+      if (!window_private->destroyed &&
+         (window_private->extension_events != 0) &&
          gdk_input_vtable.configure_event)
        gdk_input_vtable.configure_event (&xevent->xconfigure, window);
-      
+
       if (window_private->window_type == GDK_WINDOW_CHILD)
        return_val = FALSE;
       else
@@ -2714,6 +2907,7 @@ gdk_event_translate (GdkEvent *event,
       /* something else - (e.g., a Xinput event) */
       
       if (window_private &&
+         !window_private->destroyed &&
          (window_private->extension_events != 0) &&
          gdk_input_vtable.other_event)
        return_val = gdk_input_vtable.other_event(event, xevent, window);
@@ -3638,61 +3832,6 @@ _g_mbtowc (wchar_t *wstr, const char *str, size_t len)
 
 #endif /* X_LOCALE */
 
-/* 
- * used for debugging only 
- */
-#ifdef DEBUG_DND
-static void
-gdk_print_atom (GdkAtom anatom)
-{
-  gchar *tmpstr = NULL;
-  tmpstr = (anatom!=None)?gdk_atom_name(anatom):"(none)";
-  g_message("Atom %lu has name %s", anatom, tmpstr);
-  if(tmpstr)
-    g_free(tmpstr);
-}
-#endif
-
-#ifdef WE_HAVE_MOTIF_DROPS_DONE
-static GdkWindow *
-gdk_drop_get_real_window (GdkWindow   *w, 
-                         guint16     *x, 
-                         guint16     *y)
-{
-  GdkWindow *retval = w;
-  GdkWindowPrivate *awin;
-  GList *children;
-  gint16 myx = *x, myy = *y;
-  
-  g_return_val_if_fail (w != NULL && x != NULL && y != NULL, NULL);
-  
-  myx = *x; 
-  myy = *y;
-  
- descend:
-  for (children = gdk_window_get_children(retval); 
-       children && children->next;
-       children = children->next)
-    {
-      awin = (GdkWindowPrivate *) children->data;
-      if ((myx >= awin->x) && (myy >= awin->y)
-         && (myx < (awin->x + awin->width))
-         && (myy < (awin->y + awin->height)))
-       {
-         retval = (GdkWindow *) awin;
-         myx -= awin->x;
-         myy -= awin->y;
-         goto descend;
-       }
-    }
-  
-  *x = myx; 
-  *y = myy;
-  
-  return retval;
-}
-#endif
-
 /* Sends a ClientMessage to all toplevel client windows */
 gboolean
 gdk_event_send_client_message (GdkEvent *event, guint32 xid)
@@ -3716,7 +3855,7 @@ gdk_event_send_client_message (GdkEvent *event, guint32 xid)
 gboolean
 gdk_event_send_client_message_to_all_recurse (XEvent  *xev, 
                                              guint32  xid,
-                                             gboolean send_anyways)
+                                             guint    level)
 {
   static GdkAtom wm_state_atom = GDK_NONE;
 
@@ -3729,7 +3868,7 @@ gdk_event_send_client_message_to_all_recurse (XEvent  *xev,
   unsigned int ret_nchildren;
   int i;
   
-  gboolean send = TRUE;
+  gboolean send = FALSE;
   gboolean found = FALSE;
 
   if (!wm_state_atom)
@@ -3761,13 +3900,13 @@ gdk_event_send_client_message_to_all_recurse (XEvent  *xev,
        return FALSE;
 
       for(i = 0; i < ret_nchildren; i++)
-       if (gdk_event_send_client_message_to_all_recurse(xev, ret_children[i], FALSE))
+       if (gdk_event_send_client_message_to_all_recurse(xev, ret_children[i], level + 1))
          found = TRUE;
 
       XFree(ret_children);
     }
 
-  if (send || (!found && send_anyways))
+  if (send || (!found && (level == 1)))
     {
       xev->xclient.window = xid;
       gdk_send_xevent (xid, False, NoEventMask, xev);
@@ -3791,7 +3930,7 @@ gdk_event_send_clientmessage_toall (GdkEvent *event)
   memcpy(&sev.xclient.data, &event->client.data, sizeof(sev.xclient.data));
   sev.xclient.message_type = event->client.message_type;
 
-  gdk_event_send_client_message_to_all_recurse(&sev, gdk_root_window, TRUE);
+  gdk_event_send_client_message_to_all_recurse(&sev, gdk_root_window, 0);
 
   gdk_error_warnings = old_warnings;
 }
index 1d188c78a136aa8ab76a517c12669c56d1d9d4b9..5ee53061b57c4c631586b9180cad0b2e8010b376 100644 (file)
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -196,6 +196,23 @@ void gdk_window_shape_combine_mask (GdkWindow          *window,
                                    GdkBitmap       *shape_mask,
                                    gint             offset_x,
                                    gint             offset_y);
+/*
+ * This routine allows you to quickly take the shapes of all the child windows
+ * of a window and use their shapes as the shape mask for this window - useful
+ * for container windows that dont want to look like a big box
+ * 
+ * - Raster
+ */
+void gdk_window_set_child_shapes (GdkWindow *window);
+
+/*
+ * This routine allows you to merge (ie ADD) child shapes to your
+ * own window's shape keeping its current shape and ADDING the shild
+ * shapes to it.
+ * 
+ * - Raster
+ */
+void gdk_window_merge_child_shapes (GdkWindow *window);
 
 /*
  * The following function adds a global filter for all client
@@ -726,6 +743,9 @@ void        gdk_property_delete (GdkWindow   *window,
 gint gdk_rectangle_intersect (GdkRectangle *src1,
                              GdkRectangle *src2,
                              GdkRectangle *dest);
+void gdk_rectangle_union     (GdkRectangle *src1,
+                             GdkRectangle *src2,
+                             GdkRectangle *dest);
 
 /* XInput support
  */
@@ -894,6 +914,8 @@ void          gdk_threads_wake (void);
 
 /* Miscellaneous */
 void     gdk_event_send_clientmessage_toall (GdkEvent    *event);
+gboolean gdk_event_send_client_message (GdkEvent    *event,
+                                       guint32      xid);
 
 /* Key values
  */
index 63400fa99f93e920209cfb9d061436c297906318..1d2ae0131e3747246cdd970f39573373762a8345 100644 (file)
@@ -1,21 +1,3 @@
-/* GDK - The GIMP Drawing Kit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
 GDK_NUM_GLYPHS = 154,
 GDK_X_CURSOR = 0,
 GDK_ARROW = 2,
index 67720ad6bdb66c1b2946c9ddfd9e43c2ddf2d8ab..c4dc41a078c2bd225b2323a8e4ef66a086293e99 100644 (file)
@@ -377,15 +377,17 @@ gdk_window_cache_destroy (GdkWindowCache *cache)
 
 static Window
 get_client_window_at_coords_recurse (Window  win,
-                                    gint    x_root,
-                                    gint    y_root)
+                                    gint    x,
+                                    gint    y)
 {
-  Window child;
+  Window root, tmp_parent, *children;
+  unsigned int nchildren;
+  int i;
+  Window child = None;
   Atom type = None;
   int format;
   unsigned long nitems, after;
   unsigned char *data;
-  int dest_x, dest_y;
   
   static Atom wm_state_atom = None;
 
@@ -408,6 +410,8 @@ get_client_window_at_coords_recurse (Window  win,
       return win;
     }
 
+#if 0
+  /* This is beautiful! Damn Enlightenment and click-to-focus */
   XTranslateCoordinates (gdk_display, gdk_root_window, win,
                         x_root, y_root, &dest_x, &dest_y, &child);
 
@@ -416,18 +420,49 @@ get_client_window_at_coords_recurse (Window  win,
       gdk_error_code = 0;
       return None;
     }
+  
+#else
+  if (XQueryTree(gdk_display, win,
+                &root, &tmp_parent, &children, &nchildren) == 0)
+    return 0;
+
+  if (gdk_error_code == 0)
+    {
+      for (i = nchildren - 1; (i >= 0) && (child == None); i--)
+       {
+         XWindowAttributes xwa;
+         
+         XGetWindowAttributes (gdk_display, children[i], &xwa);
+         
+         if (gdk_error_code != 0)
+           gdk_error_code = 0;
+         else if ((xwa.map_state == IsViewable) && (xwa.class == InputOutput) &&
+                  (x >= xwa.x) && (x < xwa.x + (gint)xwa.width) &&
+                  (y >= xwa.y) && (y < xwa.y + (gint)xwa.height))
+           {
+             x -= xwa.x;
+             y -= xwa.y;
+             child = children[i];
+           }
+       }
+      
+      XFree (children);
+    }
+  else
+    gdk_error_code = 0;
+#endif  
 
   if (child)
-    return get_client_window_at_coords_recurse (child, x_root, y_root);
+    return get_client_window_at_coords_recurse (child, x, y);
   else
     return None;
 }
 
 Window 
 get_client_window_at_coords (GdkWindowCache *cache,
-                            Window  ignore,
-                            gint    x_root,
-                            gint    y_root)
+                            Window          ignore,
+                            gint            x_root,
+                            gint            y_root)
 {
   GList *tmp_list;
   Window retval = None;
@@ -449,7 +484,8 @@ get_client_window_at_coords (GdkWindowCache *cache,
              (y_root >= child->y) && (y_root < child->y + child->height))
            {
              retval = get_client_window_at_coords_recurse (child->xid,
-                                                           x_root, y_root);
+                                                           x_root - child->x, 
+                                                           y_root - child->y);
              if (!retval)
                retval = child->xid;
            }
@@ -532,7 +568,7 @@ get_client_window_at_coords (Window  ignore,
   if (XQueryTree(gdk_display, gdk_root_window, 
                 &root, &parent, &children, &nchildren) == 0)
     return 0;
-  
+
   for (i = nchildren - 1; (i >= 0) && (retval == None); i--)
     {
       if (children[i] != ignore)
@@ -883,7 +919,12 @@ motif_read_target_table (void)
            goto error;
 
          n_targets = card16_to_host (*(gushort *)p, header->byte_order);
-         targets = (guint32 *)(p + sizeof(guint16));
+
+         /* We need to make a copy of the targets, since it may
+          * be unaligned
+          */
+         targets = g_new (guint32, n_targets);
+         memcpy (targets, p + sizeof(guint16), sizeof(guint32) * n_targets);
 
          p +=  sizeof(guint16) + n_targets * sizeof(guint32);
          if (p - target_bytes > nitems)
@@ -894,7 +935,7 @@ motif_read_target_table (void)
              g_list_prepend (motif_target_lists[i],
                              GUINT_TO_POINTER (card32_to_host (targets[j], 
                                                                header->byte_order)));
-
+         g_free (targets);
          motif_target_lists[i] = g_list_reverse (motif_target_lists[i]);
        }
 
@@ -1001,7 +1042,6 @@ motif_add_to_target_table (GList *targets)
          guchar *data;
          guchar *p;
          guint16 *p16;
-         guint32 *p32;
          MotifTargetTableHeader *header;
          
          if (!motif_target_lists)
@@ -1035,20 +1075,27 @@ motif_add_to_target_table (GList *targets)
 
          for (i = 0; i < motif_n_target_lists ; i++)
            {
-             guint16 count = 0;
+             guint16 n_targets = g_list_length (motif_target_lists[i]);
+             guint32 *targets = g_new (guint32, n_targets);
+             guint32 *p32 = targets;
              
-             p16 = (guint16 *)p;
-             p += sizeof(guint16);
-             p32 = (guint32 *)p;
              tmp_list = motif_target_lists[i];
              while (tmp_list)
                {
-                 *p32++ = GPOINTER_TO_UINT (tmp_list->data);
+                 *p32 = GPOINTER_TO_UINT (tmp_list->data);
+                 
                  tmp_list = tmp_list->next;
-                 count++;
+                 p32++;
                }
-             *p16 = count;
-             p = (guchar *)p32;
+
+             p16 = (guint16 *)p;
+             p += sizeof(guint16);
+
+             memcpy (p, targets, n_targets * sizeof(guint32));
+
+             *p16 = n_targets;
+             p += sizeof(guint32) * n_targets;
+             g_free (targets);
            }
 
          XChangeProperty (gdk_display, motif_drag_window,
index 0b8f91266e9d1c5ff412268bad0a84d35a310cbb..730ec63ad90258baeb0a32ac27d8fc934f9fbbd7 100644 (file)
@@ -676,7 +676,7 @@ gdk_gc_set_clip_rectangle (GdkGC    *gc,
 {
   GdkGCPrivate *private;
   XRectangle xrectangle;
-
+   
   g_return_if_fail (gc != NULL);
 
   private = (GdkGCPrivate*) gc;
index 4d009f9f42108efad91fe6958b49dd0cf55c3a9b..2cc850b5321e26e4af814c818393d9dd935ed3ee 100644 (file)
@@ -353,7 +353,8 @@ gdk_image_get (GdkWindow *window,
 
   image->mem = private->ximage->data;
   image->bpl = private->ximage->bytes_per_line;
-  image->bpp = 1;
+  image->bpp = private->ximage->bits_per_pixel;
+  image->byte_order = private->ximage->byte_order;
 
   return image;
 }
index 997fdd207b584122b1c4205a5e3d2fc718fba1e2..7b69d6197fdbb516ffd4ad66295fafe6704be817 100644 (file)
@@ -173,7 +173,7 @@ gdk_input_xfree_configure_event (XConfigureEvent *xevent, GdkWindow *window)
 
 static void 
 gdk_input_xfree_enter_event (XCrossingEvent *xevent, 
-                                      GdkWindow *window)
+                            GdkWindow      *window)
 {
   GdkInputWindow *input_window;
   gint root_x, root_y;
index 781db81b1f7bfe9abe8f4b1713576f5e97e3db9a..d7f71cd22479b6878b9dadbd147acdc55e54f98e 100644 (file)
@@ -24,8 +24,6 @@
 #include <X11/Xutil.h>
 #include <gdk/gdktypes.h>
 
-#define DND_PROTOCOL_VERSION 0
-
 #define gdk_window_lookup(xid)    ((GdkWindow*) gdk_xid_table_lookup (xid))
 #define gdk_pixmap_lookup(xid)    ((GdkPixmap*) gdk_xid_table_lookup (xid))
 #define gdk_font_lookup(xid)      ((GdkFont*) gdk_xid_table_lookup (xid))
@@ -65,20 +63,6 @@ struct _GdkWindowPrivate
   guint8 window_type;
   guint ref_count;
   guint destroyed : 2;
-  guint dnd_drag_enabled : 1,
-    dnd_drag_datashow : 1,
-    dnd_drag_destructive_op : 1,
-    dnd_drag_accepted : 1,
-    dnd_drop_enabled : 1,
-    dnd_drop_destructive_op : 1;
-  GdkAtom dnd_drag_data_type, *dnd_drag_data_typesavail;
-  guint dnd_drag_data_numtypesavail;
-  /* We have to turn on MotionMask/EnterWindowMask/LeaveWindowMask
-     during drags, then set it back to what it was after */
-  glong dnd_drag_savedeventmask, dnd_drag_eventmask;
-  GdkAtom *dnd_drop_data_typesavail;
-  guint dnd_drop_data_numtypesavail;
-  /* need to allow custom drag/drop cursors */
 
   gint extension_events;
 
index 18bfa653a457385e774805843e01457d67a1fca4..e1d1d300fa66ad46cbe67e569118c5aaa7d77814 100644 (file)
 #include "gdk.h"
 
 
+
+void
+gdk_rectangle_union (GdkRectangle *src1,
+                    GdkRectangle *src2,
+                    GdkRectangle *dest)
+{
+  dest->x = MIN (src1->x, src2->x);
+  dest->y = MIN (src1->y, src2->y);
+  dest->width = 
+    MAX (src1->x + src1->width, src2->x + src2->width) - dest->x;
+  dest->height = 
+    MAX (src1->y + src1->height, src2->y + src2->height) - dest->y;
+}
+
 gint
 gdk_rectangle_intersect (GdkRectangle *src1,
                         GdkRectangle *src2,
index 011dd290a4f440540cd643565410a0169006e031..455246c7fe26001270094b4b20f5ddc89504401a 100644 (file)
@@ -538,12 +538,12 @@ gdk_rgb_init (void)
   gint byte_order[1] = { 1 };
 
   /* check endian sanity */
-#ifdef WORDS_BIGENDIAN
+#if G_BYTE_ORDER == G_BIG_ENDIAN
   if (((char *)byte_order)[0] == 1)
-    g_error ("gdk_rgb_init: WORDS_BIGENDIAN is defined, but this is a little endian machine.\n\n");
+    g_error ("gdk_rgb_init: compiled for big endian, but this is a little endian machine.\n\n");
 #else
   if (((char *)byte_order)[0] != 1)
-    g_error ("gdk_rgb_init: WORDS_BIGENDIAN is not defined, but this is a big endian machine.\n\n");
+    g_error ("gdk_rgb_init: compiled for little endian, but this is a big endian machine.\n\n");
 #endif
 
   if (image_info == NULL)
@@ -649,7 +649,7 @@ gdk_rgb_init (void)
 gulong
 gdk_rgb_xpixel_from_rgb (guint32 rgb)
 {
-  gulong pixel;
+  gulong pixel = 0;
 
   if (image_info->bitmap)
     {
@@ -722,7 +722,7 @@ gdk_rgb_gc_set_background (GdkGC *gc, guint32 rgb)
   gdk_gc_set_background (gc, &color);
 }
 
-#ifndef WORDS_BIGENDIAN
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
 #define HAIRY_CONVERT_8
 #endif
 
@@ -1186,7 +1186,7 @@ gdk_rgb_convert_gray8_gray (GdkImage *image,
     }
 }
 
-#ifndef WORDS_BIGENDIAN
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
 #define HAIRY_CONVERT_565
 #endif
 
@@ -1729,7 +1729,7 @@ gdk_rgb_convert_888_msb (GdkImage *image,
 }
 
 /* todo: optimize this */
-#ifndef WORDS_BIGENDIAN
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
 #define HAIRY_CONVERT_888
 #endif
 
@@ -2668,7 +2668,7 @@ gdk_rgb_select_conv (GdkImage *image)
             (gint)(((GdkVisualPrivate *)image_info->visual)->xvisual->visualid),
             bpp, byte_order == GDK_LSB_FIRST ? "lsb" : "msb");
 
-#ifdef WORDS_BIGENDIAN
+#if G_BYTE_ORDER == G_BIG_ENDIAN
   byterev = (byte_order == GDK_LSB_FIRST);
 #else
   byterev = (byte_order == GDK_MSB_FIRST);
@@ -2733,7 +2733,7 @@ gdk_rgb_select_conv (GdkImage *image)
           ((mask_rgb && byte_order == GDK_MSB_FIRST) ||
            (mask_bgr && byte_order == GDK_LSB_FIRST)))
     conv = gdk_rgb_convert_888_msb;
-#ifdef WORDS_BIGENDIAN
+#if G_BYTE_ORDER == G_BIG_ENDIAN
   else if (bpp == 32 && depth == 24 && vtype == GDK_VISUAL_TRUE_COLOR &&
           (mask_rgb && byte_order == GDK_LSB_FIRST))
     conv = gdk_rgb_convert_0888_br;
index 3df6ac8ac19a24e579671e3981fa83336305711a..002696b8729116e1905d156504ac0a3d63976d60 100644 (file)
@@ -58,6 +58,7 @@ int event_mask_table[20] =
   SubstructureNotifyMask
 };
 
+static gboolean gdk_window_have_shape_ext (void);
 
 /* internal function created for and used by gdk_window_xid_at_coords */
 Window
@@ -285,14 +286,6 @@ gdk_window_new (GdkWindow     *parent,
   private->height = (attributes->height > 1) ? (attributes->height) : (1);
   private->window_type = attributes->window_type;
   private->extension_events = FALSE;
-  private->dnd_drag_data_type = None;
-  private->dnd_drag_data_typesavail =
-    private->dnd_drop_data_typesavail = NULL;
-  private->dnd_drop_enabled = private->dnd_drag_enabled =
-    private->dnd_drag_accepted = private->dnd_drag_datashow =
-    private->dnd_drop_data_numtypesavail =
-    private->dnd_drag_data_numtypesavail = 0;
-  private->dnd_drag_eventmask = private->dnd_drag_savedeventmask = 0;
 
   private->filters = NULL;
   private->children = NULL;
@@ -506,15 +499,6 @@ gdk_window_foreign_new (guint32 anid)
 
   private->colormap = NULL;
 
-  private->dnd_drag_data_type = None;
-  private->dnd_drag_data_typesavail =
-    private->dnd_drop_data_typesavail = NULL;
-  private->dnd_drop_enabled = private->dnd_drag_enabled =
-    private->dnd_drag_accepted = private->dnd_drag_datashow =
-    private->dnd_drop_data_numtypesavail =
-    private->dnd_drag_data_numtypesavail = 0;
-  private->dnd_drag_eventmask = private->dnd_drag_savedeventmask = 0;
-
   private->filters = NULL;
   private->children = NULL;
 
@@ -584,17 +568,6 @@ gdk_window_internal_destroy (GdkWindow *window, gboolean xdestroy,
          if (private->extension_events != 0)
            gdk_input_window_destroy (window);
 
-         if(private->dnd_drag_data_numtypesavail > 0) 
-           {
-             g_free (private->dnd_drag_data_typesavail);
-             private->dnd_drag_data_typesavail = NULL;
-           }
-         if(private->dnd_drop_data_numtypesavail > 0) 
-           {
-             g_free (private->dnd_drop_data_typesavail);
-             private->dnd_drop_data_typesavail = NULL;
-           }
-
          if (private->filters)
            {
              tmp = private->filters;
@@ -1629,6 +1602,24 @@ gdk_window_add_colormap_windows (GdkWindow *window)
     XFree (old_windows);
 }
 
+static gboolean
+gdk_window_have_shape_ext (void)
+{
+  enum { UNKNOWN, NO, YES };
+  static gint have_shape = UNKNOWN;
+
+  if (have_shape == UNKNOWN)
+    {
+      int ignore;
+      if (XQueryExtension(gdk_display, "SHAPE", &ignore, &ignore, &ignore))
+       have_shape = YES;
+      else
+       have_shape = NO;
+    }
+
+  return (have_shape == YES);
+}
+
 /*
  * This needs the X11 shape extension.
  * If not available, shaped windows will look
@@ -1639,31 +1630,18 @@ gdk_window_shape_combine_mask (GdkWindow *window,
                               GdkBitmap *mask,
                               gint x, gint y)
 {
-  enum { UNKNOWN, NO, YES };
-
-  static gint have_shape = UNKNOWN;
-
   GdkWindowPrivate *window_private;
   Pixmap pixmap;
 
   g_return_if_fail (window != NULL);
 
 #ifdef HAVE_SHAPE_EXT
-  if (have_shape == UNKNOWN)
-    {
-      int ignore;
-      if (XQueryExtension(gdk_display, "SHAPE", &ignore, &ignore, &ignore))
-       have_shape = YES;
-      else
-       have_shape = NO;
-    }
-  
-  if (have_shape == YES)
+  window_private = (GdkWindowPrivate*) window;
+  if (window_private->destroyed)
+    return;
+
+  if (gdk_window_have_shape_ext())
     {
-      window_private = (GdkWindowPrivate*) window;
-      if (window_private->destroyed)
-       return;
-      
       if (mask)
        {
          GdkWindowPrivate *pixmap_private;
@@ -1960,6 +1938,344 @@ gdk_window_get_toplevels (void)
   return new_list;
 }
 
+/* 
+ * propagate the shapes from all child windows of a GDK window to the parent 
+ * window. Shamelessly ripped from Enlightenment's code
+ * 
+ * - Raster
+ */
+
+struct _gdk_span
+{
+   gint                start;
+   gint                end;
+   struct _gdk_span    *next;
+};
+
+static void
+gdk_add_to_span(struct _gdk_span **s, int x, int xx)
+{
+   struct _gdk_span   *ptr1, *ptr2, *noo, *ss;
+   gchar               spanning;
+   
+   ptr2 = NULL;
+   ptr1 = *s;
+   spanning = 0;
+   ss = NULL;
+   /* scan the spans for this line */
+   while (ptr1)
+     {
+       /* -- -> new span */
+       /* == -> existing span */
+       /* ## -> spans intersect */
+       /* if we are in the middle of spanning the span into the line */
+       if (spanning)
+         {
+            /* case: ---- ==== */
+            if (xx < ptr1->start - 1)
+              {
+                 /* ends before next span - extend to here */
+                 ss->end = xx;
+                 return;
+              }
+            /* case: ----##=== */
+            else if (xx <= ptr1->end)
+              {
+                 /* crosses into next span - delete next span and append */
+                 ss->end = ptr1->end;
+                 ss->next = ptr1->next;
+                 g_free(ptr1);
+                 return;
+              }
+            /* case: ---###--- */
+            else
+              {
+                 /* overlaps next span - delete and keep checking */
+                 ss->next = ptr1->next;
+                 g_free(ptr1);
+                 ptr1 = ss;
+              }
+         }
+       /* otherwise havent started spanning it in yet */
+       else
+         {
+            /* case: ---- ==== */
+            if (xx < ptr1->start - 1)
+              {
+                 /* insert span here in list */
+                 noo = g_malloc(sizeof(struct _gdk_span));
+                 
+                 if (noo)
+                   {
+                      noo->start = x;
+                      noo->end = xx;
+                      noo->next = ptr1;
+                      if (ptr2)
+                        ptr2->next = noo;
+                      else
+                        *s = noo;
+                   }
+                 return;
+              }
+            /* case: ----##=== */
+            else if ((x < ptr1->start) && (xx <= ptr1->end))
+              {
+                 /* expand this span to the left point of the new one */
+                 ptr1->start = x;
+                 return;
+              }
+            /* case: ===###=== */
+            else if ((x >= ptr1->start) && (xx <= ptr1->end))
+              {
+                 /* throw the span away */
+                 return;
+              }
+            /* case: ---###--- */
+            else if ((x < ptr1->start) && (xx > ptr1->end))
+              {
+                 ss = ptr1;
+                 spanning = 1;
+                 ptr1->start = x;
+                 ptr1->end = xx;
+              }
+            /* case: ===##---- */
+            else if ((x >= ptr1->start) && (x <= ptr1->end + 1) && (xx > ptr1->end))
+              {
+                 ss = ptr1;
+                 spanning = 1;
+                 ptr1->end = xx;
+              }
+            /* case: ==== ---- */
+            /* case handled by next loop iteration - first case */
+         }
+       ptr2 = ptr1;
+       ptr1 = ptr1->next;
+     }
+   /* it started in the middle but spans beyond your current list */
+   if (spanning)
+     {
+       ptr2->end = xx;
+       return;
+     }
+   /* it does not start inside a span or in the middle, so add it to the end */
+   noo = g_malloc(sizeof(struct _gdk_span));
+   
+   if (noo)
+     {
+       noo->start = x;
+       noo->end = xx;
+       if (ptr2)
+         {
+            noo->next = ptr2->next;
+            ptr2->next = noo;
+         }
+       else
+         {
+            noo->next = NULL;
+            *s = noo;
+         }
+     }
+   return;
+}
+
+static void
+gdk_add_rectangles (Display *disp, Window win, struct _gdk_span **spans,
+                   gint basew, gint baseh, gint x, gint y)
+{
+  gint a, k;
+  gint x1, y1, x2, y2;
+  gint rn, ord;
+  XRectangle *rl;
+
+  rl = XShapeGetRectangles(disp, win, ShapeBounding, &rn, &ord);
+  if (rl)
+    {
+      /* go through all clip rects in this window's shape */
+      for (k = 0; k < rn; k++)
+       {
+         /* for each clip rect, add it to each line's spans */
+         x1 = x + rl[k].x;
+         x2 = x + rl[k].x + (rl[k].width - 1);
+         y1 = y + rl[k].y;
+         y2 = y + rl[k].y + (rl[k].height - 1);
+         if (x1 < 0)
+           x1 = 0;
+         if (y1 < 0)
+           y1 = 0;
+         if (x2 >= basew)
+           x2 = basew - 1;
+         if (y2 >= baseh)
+           y2 = baseh - 1;
+         for (a = y1; a <= y2; a++)
+           {
+             if ((x2 - x1) >= 0)
+               gdk_add_to_span(&spans[a], x1, x2);
+           }
+       }
+      XFree(rl);
+    }
+}
+
+static void
+gdk_propagate_shapes(Display *disp, Window win, gboolean merge)
+{
+   Window              rt, par, *list = NULL;
+   gint                i, j, num = 0, num_rects = 0;
+   gint                x, y, contig;
+   guint               w, h, d;
+   gint                baseh, basew;
+   XRectangle         *rects = NULL;
+   struct _gdk_span  **spans = NULL, *ptr1, *ptr2, *ptr3;
+   XWindowAttributes   xatt;
+   
+   XGetGeometry(disp, win, &rt, &x, &y, &w, &h, &d, &d);
+   if (h <= 0)
+     return;
+   basew = w;
+   baseh = h;
+   spans = g_malloc(sizeof(struct _gdk_span *) * h);
+   
+   for (i = 0; i < h; i++)
+     spans[i] = NULL;
+   XQueryTree(disp, win, &rt, &par, &list, (unsigned int *)&num);
+   if (list)
+     {
+       /* go through all child windows and create/insert spans */
+       for (i = 0; i < num; i++)
+         {
+            if (XGetWindowAttributes(disp, list[i], &xatt) && (xatt.map_state != IsUnmapped))
+              if (XGetGeometry(disp, list[i], &rt, &x, &y, &w, &h, &d, &d))
+                gdk_add_rectangles (disp, list[i], spans, basew, baseh, x, y);
+         }
+       if (merge)
+         gdk_add_rectangles (disp, win, spans, basew, baseh, x, y);
+
+       /* go through the spans list and build a list of rects */
+       rects = g_malloc(sizeof(XRectangle) * 256);
+       num_rects = 0;
+       for (i = 0; i < baseh; i++)
+         {
+            ptr1 = spans[i];
+            /* go through the line for all spans */
+            while (ptr1)
+              {
+                 rects[num_rects].x = ptr1->start;
+                 rects[num_rects].y = i;
+                 rects[num_rects].width = ptr1->end - ptr1->start + 1;
+                 rects[num_rects].height = 1;
+                 j = i + 1;
+                 /* if there are more lines */
+                 contig = 1;
+                 /* while contigous rects (same start/end coords) exist */
+                 while ((contig) && (j < baseh))
+                   {
+                      /* search next line for spans matching this one */
+                      contig = 0;
+                      ptr2 = spans[j];
+                      ptr3 = NULL;
+                      while (ptr2)
+                        {
+                           /* if we have an exact span match set contig */
+                           if ((ptr2->start == ptr1->start) &&
+                               (ptr2->end == ptr1->end))
+                             {
+                                contig = 1;
+                                /* remove the span - not needed */
+                                if (ptr3)
+                                  {
+                                     ptr3->next = ptr2->next;
+                                     g_free(ptr2);
+                                     ptr2 = NULL;
+                                  }
+                                else
+                                  {
+                                     spans[j] = ptr2->next;
+                                     g_free(ptr2);
+                                     ptr2 = NULL;
+                                  }
+                                break;
+                             }
+                           /* gone past the span point no point looking */
+                           else if (ptr2->start < ptr1->start)
+                             break;
+                           if (ptr2)
+                             {
+                                ptr3 = ptr2;
+                                ptr2 = ptr2->next;
+                             }
+                        }
+                      /* if a contiguous span was found increase the rect h */
+                      if (contig)
+                        {
+                           rects[num_rects].height++;
+                           j++;
+                        }
+                   }
+                 /* up the rect count */
+                 num_rects++;
+                 /* every 256 new rects increase the rect array */
+                 if ((num_rects % 256) == 0)
+                   rects = g_realloc(rects, sizeof(XRectangle) * (num_rects + 256));
+                 ptr1 = ptr1->next;
+              }
+         }
+       /* set the rects as the shape mask */
+       if (rects)
+         {
+            XShapeCombineRectangles(disp, win, ShapeBounding, 0, 0, rects, num_rects,
+                                    ShapeSet, YXSorted);
+            g_free(rects);
+         }
+       XFree(list);
+     }
+   /* free up all the spans we made */
+   for (i = 0; i < baseh; i++)
+     {
+       ptr1 = spans[i];
+       while (ptr1)
+         {
+            ptr2 = ptr1;
+            ptr1 = ptr1->next;
+            g_free(ptr2);
+         }
+     }
+   g_free(spans);
+}
+
+void
+gdk_window_set_child_shapes (GdkWindow *window)
+{
+  GdkWindowPrivate *private;
+   
+  g_return_if_fail (window != NULL);
+   
+#ifdef HAVE_SHAPE_EXT
+  private = (GdkWindowPrivate*) window;
+  if (private->destroyed)
+    return;
+
+  if (gdk_window_have_shape_ext())
+    gdk_propagate_shapes (private->xdisplay, private->xwindow, FALSE);
+#endif   
+}
+
+void
+gdk_window_merge_child_shapes (GdkWindow *window)
+{
+  GdkWindowPrivate *private;
+  
+  g_return_if_fail (window != NULL);
+  
+#ifdef HAVE_SHAPE_EXT
+  private = (GdkWindowPrivate*) window;
+  if (private->destroyed)
+    return;
+
+  if (gdk_window_have_shape_ext())
+    gdk_propagate_shapes (private->xdisplay, private->xwindow, TRUE);
+#endif   
+}
+
 void          
 gdk_drawable_set_data (GdkDrawable   *drawable,
                       const gchar   *key,
diff --git a/gdk/makecursors.awk b/gdk/makecursors.awk
deleted file mode 100755 (executable)
index aee14c8..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-$1 == "#define" && NF >= 3 {
-    sub(/^XC/,"GDK",$2)
-    printf("%s = %s,\n",toupper($2),$3)
-}
diff --git a/gdk/makekeysyms.awk b/gdk/makekeysyms.awk
deleted file mode 100755 (executable)
index dbf2a1b..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-$1 == "#define" && NF >= 3 {
-    sub(/^XK/,"GDK",$2)
-    sub(/0X/,"0x",$3)
-    print $1,$2,$3
-}
index 67720ad6bdb66c1b2946c9ddfd9e43c2ddf2d8ab..c4dc41a078c2bd225b2323a8e4ef66a086293e99 100644 (file)
@@ -377,15 +377,17 @@ gdk_window_cache_destroy (GdkWindowCache *cache)
 
 static Window
 get_client_window_at_coords_recurse (Window  win,
-                                    gint    x_root,
-                                    gint    y_root)
+                                    gint    x,
+                                    gint    y)
 {
-  Window child;
+  Window root, tmp_parent, *children;
+  unsigned int nchildren;
+  int i;
+  Window child = None;
   Atom type = None;
   int format;
   unsigned long nitems, after;
   unsigned char *data;
-  int dest_x, dest_y;
   
   static Atom wm_state_atom = None;
 
@@ -408,6 +410,8 @@ get_client_window_at_coords_recurse (Window  win,
       return win;
     }
 
+#if 0
+  /* This is beautiful! Damn Enlightenment and click-to-focus */
   XTranslateCoordinates (gdk_display, gdk_root_window, win,
                         x_root, y_root, &dest_x, &dest_y, &child);
 
@@ -416,18 +420,49 @@ get_client_window_at_coords_recurse (Window  win,
       gdk_error_code = 0;
       return None;
     }
+  
+#else
+  if (XQueryTree(gdk_display, win,
+                &root, &tmp_parent, &children, &nchildren) == 0)
+    return 0;
+
+  if (gdk_error_code == 0)
+    {
+      for (i = nchildren - 1; (i >= 0) && (child == None); i--)
+       {
+         XWindowAttributes xwa;
+         
+         XGetWindowAttributes (gdk_display, children[i], &xwa);
+         
+         if (gdk_error_code != 0)
+           gdk_error_code = 0;
+         else if ((xwa.map_state == IsViewable) && (xwa.class == InputOutput) &&
+                  (x >= xwa.x) && (x < xwa.x + (gint)xwa.width) &&
+                  (y >= xwa.y) && (y < xwa.y + (gint)xwa.height))
+           {
+             x -= xwa.x;
+             y -= xwa.y;
+             child = children[i];
+           }
+       }
+      
+      XFree (children);
+    }
+  else
+    gdk_error_code = 0;
+#endif  
 
   if (child)
-    return get_client_window_at_coords_recurse (child, x_root, y_root);
+    return get_client_window_at_coords_recurse (child, x, y);
   else
     return None;
 }
 
 Window 
 get_client_window_at_coords (GdkWindowCache *cache,
-                            Window  ignore,
-                            gint    x_root,
-                            gint    y_root)
+                            Window          ignore,
+                            gint            x_root,
+                            gint            y_root)
 {
   GList *tmp_list;
   Window retval = None;
@@ -449,7 +484,8 @@ get_client_window_at_coords (GdkWindowCache *cache,
              (y_root >= child->y) && (y_root < child->y + child->height))
            {
              retval = get_client_window_at_coords_recurse (child->xid,
-                                                           x_root, y_root);
+                                                           x_root - child->x, 
+                                                           y_root - child->y);
              if (!retval)
                retval = child->xid;
            }
@@ -532,7 +568,7 @@ get_client_window_at_coords (Window  ignore,
   if (XQueryTree(gdk_display, gdk_root_window, 
                 &root, &parent, &children, &nchildren) == 0)
     return 0;
-  
+
   for (i = nchildren - 1; (i >= 0) && (retval == None); i--)
     {
       if (children[i] != ignore)
@@ -883,7 +919,12 @@ motif_read_target_table (void)
            goto error;
 
          n_targets = card16_to_host (*(gushort *)p, header->byte_order);
-         targets = (guint32 *)(p + sizeof(guint16));
+
+         /* We need to make a copy of the targets, since it may
+          * be unaligned
+          */
+         targets = g_new (guint32, n_targets);
+         memcpy (targets, p + sizeof(guint16), sizeof(guint32) * n_targets);
 
          p +=  sizeof(guint16) + n_targets * sizeof(guint32);
          if (p - target_bytes > nitems)
@@ -894,7 +935,7 @@ motif_read_target_table (void)
              g_list_prepend (motif_target_lists[i],
                              GUINT_TO_POINTER (card32_to_host (targets[j], 
                                                                header->byte_order)));
-
+         g_free (targets);
          motif_target_lists[i] = g_list_reverse (motif_target_lists[i]);
        }
 
@@ -1001,7 +1042,6 @@ motif_add_to_target_table (GList *targets)
          guchar *data;
          guchar *p;
          guint16 *p16;
-         guint32 *p32;
          MotifTargetTableHeader *header;
          
          if (!motif_target_lists)
@@ -1035,20 +1075,27 @@ motif_add_to_target_table (GList *targets)
 
          for (i = 0; i < motif_n_target_lists ; i++)
            {
-             guint16 count = 0;
+             guint16 n_targets = g_list_length (motif_target_lists[i]);
+             guint32 *targets = g_new (guint32, n_targets);
+             guint32 *p32 = targets;
              
-             p16 = (guint16 *)p;
-             p += sizeof(guint16);
-             p32 = (guint32 *)p;
              tmp_list = motif_target_lists[i];
              while (tmp_list)
                {
-                 *p32++ = GPOINTER_TO_UINT (tmp_list->data);
+                 *p32 = GPOINTER_TO_UINT (tmp_list->data);
+                 
                  tmp_list = tmp_list->next;
-                 count++;
+                 p32++;
                }
-             *p16 = count;
-             p = (guchar *)p32;
+
+             p16 = (guint16 *)p;
+             p += sizeof(guint16);
+
+             memcpy (p, targets, n_targets * sizeof(guint32));
+
+             *p16 = n_targets;
+             p += sizeof(guint32) * n_targets;
+             g_free (targets);
            }
 
          XChangeProperty (gdk_display, motif_drag_window,
index 4d009f9f42108efad91fe6958b49dd0cf55c3a9b..2cc850b5321e26e4af814c818393d9dd935ed3ee 100644 (file)
@@ -353,7 +353,8 @@ gdk_image_get (GdkWindow *window,
 
   image->mem = private->ximage->data;
   image->bpl = private->ximage->bytes_per_line;
-  image->bpp = 1;
+  image->bpp = private->ximage->bits_per_pixel;
+  image->byte_order = private->ximage->byte_order;
 
   return image;
 }
index 997fdd207b584122b1c4205a5e3d2fc718fba1e2..7b69d6197fdbb516ffd4ad66295fafe6704be817 100644 (file)
@@ -173,7 +173,7 @@ gdk_input_xfree_configure_event (XConfigureEvent *xevent, GdkWindow *window)
 
 static void 
 gdk_input_xfree_enter_event (XCrossingEvent *xevent, 
-                                      GdkWindow *window)
+                            GdkWindow      *window)
 {
   GdkInputWindow *input_window;
   gint root_x, root_y;
index 449ad4add8a4e1531f13b7887da64dc0d6650ff1..217724417c9c3bb309eec42894a43eba573bca6b 100644 (file)
@@ -116,10 +116,6 @@ static Bool         gdk_event_get_type     (Display      *display,
 static void     gdk_synthesize_click   (GdkEvent     *event, 
                                         gint          nclicks);
 
-#ifdef DEBUG_DND
-static void     gdk_print_atom         (GdkAtom       anatom);
-#endif
-
 #ifndef HAVE_XCONVERTCASE
 static void     gdkx_XConvertCase      (KeySym        symbol,
                                         KeySym       *lower,
@@ -156,12 +152,12 @@ static gint   gdk_im_open         (XrmDatabase db,
 static void   gdk_im_close             (void);
 static void   gdk_ic_cleanup           (void);
 
+#endif /* USE_XIM */
+
 GdkFilterReturn gdk_wm_protocols_filter (GdkXEvent *xev,
                                         GdkEvent  *event,
                                         gpointer   data);
 
-#endif /* USE_XIM */
-
 /* Private variable declarations
  */
 static int gdk_initialized = 0;                            /* 1 if the library is initialized,
@@ -743,6 +739,194 @@ gdk_event_get_graphics_expose (GdkWindow *window)
   return NULL; 
 }
 
+/************************
+ * Exposure compression *
+ ************************/
+
+/*
+ * The following implements simple exposure compression. It is
+ * modelled after the way Xt does exposure compression - in
+ * particular compress_expose = XtExposeCompressMultiple.
+ * It compress consecutive sequences of exposure events,
+ * but not sequences that cross other events. (This is because
+ * if it crosses a ConfigureNotify, we could screw up and
+ * mistakenly compress the exposures generated for the new
+ * size - could we just check for ConfigureNotify?)
+ *
+ * Xt compresses to a region / bounding rectangle, we compress
+ * to two rectangles, and try find the two rectangles of minimal
+ * area for this - this is supposed to handle the typical
+ * L-shaped regions generated by OpaqueMove.
+ */
+
+/* Given three rectangles, find the two rectangles that cover
+ * them with the smallest area.
+ */
+static void
+gdk_add_rect_to_rects (GdkRectangle *rect1,
+                      GdkRectangle *rect2, 
+                      GdkRectangle *new_rect)
+{
+  GdkRectangle t1, t2, t3;
+  gint size1, size2, size3;
+
+  gdk_rectangle_union (rect1, rect2, &t1);
+  gdk_rectangle_union (rect1, new_rect, &t2);
+  gdk_rectangle_union (rect2, new_rect, &t3);
+
+  size1 = t1.width * t1.height + new_rect->width * new_rect->height;
+  size2 = t2.width * t2.height + rect2->width * rect2->height;
+  size3 = t1.width * t1.height + rect1->width * rect1->height;
+
+  if (size1 < size2)
+    {
+      if (size1 < size3)
+       {
+         *rect1 = t1;
+         *rect2 = *new_rect;
+       }
+      else
+       *rect2 = t3;
+    }
+  else
+    {
+      if (size2 < size3)
+       *rect1 = t2;
+      else
+       *rect2 = t3;
+    }
+}
+
+typedef struct _GdkExposeInfo GdkExposeInfo;
+
+struct _GdkExposeInfo {
+  Window window;
+  gboolean seen_nonmatching;
+};
+
+Bool
+expose_predicate (Display *display, XEvent *xevent, XPointer arg)
+{
+  GdkExposeInfo *info = (GdkExposeInfo *)arg;
+
+  if (xevent->xany.type != Expose)
+    {
+      info->seen_nonmatching = TRUE;
+    }
+
+  if (info->seen_nonmatching || (xevent->xany.window != info->window))
+    return FALSE;
+  else
+    return TRUE;
+}
+
+void
+gdk_compress_exposures (XEvent *xevent, GdkWindow *window)
+{
+  gint nrects = 1;
+  gint count = 0;
+  GdkRectangle rect1;
+  GdkRectangle rect2;
+  GdkRectangle tmp_rect;
+  XEvent tmp_event;
+  GdkFilterReturn result;
+  GdkExposeInfo info;
+  GdkEvent event;
+
+  info.window = xevent->xany.window;
+  info.seen_nonmatching = FALSE;
+  
+  rect1.x = xevent->xexpose.x;
+  rect1.y = xevent->xexpose.y;
+  rect1.width = xevent->xexpose.width;
+  rect1.height = xevent->xexpose.height;
+
+  while (1)
+    {
+      if (count == 0)
+       {
+         if (!XCheckIfEvent (gdk_display, 
+                             &tmp_event, 
+                             expose_predicate, 
+                             (XPointer)&info))
+           break;
+       }
+      else
+       XIfEvent (gdk_display, 
+                 &tmp_event, 
+                 expose_predicate, 
+                 (XPointer)&info);
+      
+      /* We apply filters here, and if it was filtered, completely
+       * ignore the return
+       */
+      result = gdk_event_apply_filters (xevent, &event,
+                                       window ? 
+                                         ((GdkWindowPrivate *)window)->filters
+                                         : gdk_default_filters);
+      
+      if (result != GDK_FILTER_CONTINUE)
+       {
+         if (result == GDK_FILTER_TRANSLATE)
+           gdk_event_put (&event);
+         continue;
+       }
+
+      if (nrects == 1)
+       {
+         rect2.x = tmp_event.xexpose.x;
+         rect2.y = tmp_event.xexpose.y;
+         rect2.width = tmp_event.xexpose.width;
+         rect2.height = tmp_event.xexpose.height;
+
+         nrects++;
+       }
+      else
+       {
+         tmp_rect.x = tmp_event.xexpose.x;
+         tmp_rect.y = tmp_event.xexpose.y;
+         tmp_rect.width = tmp_event.xexpose.width;
+         tmp_rect.height = tmp_event.xexpose.height;
+
+         gdk_add_rect_to_rects (&rect1, &rect2, &tmp_rect);
+       }
+
+      count = tmp_event.xexpose.count;
+    }
+
+  if (nrects == 2)
+    {
+      gdk_rectangle_union (&rect1, &rect2, &tmp_rect);
+
+      if ((tmp_rect.width * tmp_rect.height) <
+         2 * (rect1.height * rect1.width +
+              rect2.height * rect2.width))
+       {
+         rect1 = tmp_rect;
+         nrects = 1;
+       }
+    }
+
+  if (nrects == 2)
+    {
+      event.expose.type = GDK_EXPOSE;
+      event.expose.window = window;
+      event.expose.area.x = rect2.x;
+      event.expose.area.y = rect2.y;
+      event.expose.area.width = rect2.width;
+      event.expose.area.height = rect2.height;
+      event.expose.count = 0;
+
+      gdk_event_put (&event);
+    }
+
+  xevent->xexpose.count = nrects - 1;
+  xevent->xexpose.x = rect1.x;
+  xevent->xexpose.y = rect1.y;
+  xevent->xexpose.width = rect1.width;
+  xevent->xexpose.height = rect1.height;
+}
+
 /*
  *--------------------------------------------------------------
  * gdk_event_get
@@ -834,6 +1018,7 @@ gdk_event_get (void)
 #else
       XNextEvent (gdk_display, &xevent);
 #endif
+      
       event = gdk_event_new ();
       
       event->any.type = GDK_NOTHING;
@@ -2005,6 +2190,13 @@ gdk_event_translate (GdkEvent *event,
     case KeyRelease:
       /* Lookup the string corresponding to the given keysym.
        */
+#ifdef USE_XIM
+      if (buf_len == 0) 
+       {
+         buf_len = 128;
+         buf = g_new (gchar, buf_len);
+       }
+#endif
       keysym = GDK_VoidSymbol;
       charcount = XLookupString (&xevent->xkey, buf, 16,
                                 &keysym, &compose);
@@ -2031,8 +2223,7 @@ gdk_event_translate (GdkEvent *event,
       /* Print debugging info.
        */
       GDK_NOTE (EVENTS, 
-               g_message ("button press[%d]:\t\twindow: %ld  x,y: %d %d  button: %d",
-                          window_private?window_private->dnd_drag_enabled:0,
+               g_message ("button press:\t\twindow: %ld  x,y: %d %d  button: %d",
                           xevent->xbutton.window - base_id,
                           xevent->xbutton.x, xevent->xbutton.y,
                           xevent->xbutton.button));
@@ -2102,8 +2293,7 @@ gdk_event_translate (GdkEvent *event,
       /* Print debugging info.
        */
       GDK_NOTE (EVENTS, 
-               g_message ("button release[%d]:\twindow: %ld  x,y: %d %d  button: %d",
-                          window_private?window_private->dnd_drag_enabled:0,
+               g_message ("button release:\twindow: %ld  x,y: %d %d  button: %d",
                           xevent->xbutton.window - base_id,
                           xevent->xbutton.x, xevent->xbutton.y,
                           xevent->xbutton.button));
@@ -2178,6 +2368,7 @@ gdk_event_translate (GdkEvent *event,
       
       /* Tell XInput stuff about it if appropriate */
       if (window_private &&
+         !window_private->destroyed &&
          (window_private->extension_events != 0) &&
          gdk_input_vtable.enter_event)
        gdk_input_vtable.enter_event (&xevent->xcrossing, window);
@@ -2357,6 +2548,7 @@ gdk_event_translate (GdkEvent *event,
                           xevent->xexpose.window - base_id, xevent->xexpose.count,
                           xevent->xexpose.x, xevent->xexpose.y,
                           xevent->xexpose.width, xevent->xexpose.height));
+      gdk_compress_exposures (xevent, window);
       
       event->expose.type = GDK_EXPOSE;
       event->expose.window = window;
@@ -2539,10 +2731,11 @@ gdk_event_translate (GdkEvent *event,
                           xevent->xconfigure.above - base_id,
                           xevent->xconfigure.override_redirect));
       
-      if ((window_private->extension_events != 0) &&
+      if (!window_private->destroyed &&
+         (window_private->extension_events != 0) &&
          gdk_input_vtable.configure_event)
        gdk_input_vtable.configure_event (&xevent->xconfigure, window);
-      
+
       if (window_private->window_type == GDK_WINDOW_CHILD)
        return_val = FALSE;
       else
@@ -2714,6 +2907,7 @@ gdk_event_translate (GdkEvent *event,
       /* something else - (e.g., a Xinput event) */
       
       if (window_private &&
+         !window_private->destroyed &&
          (window_private->extension_events != 0) &&
          gdk_input_vtable.other_event)
        return_val = gdk_input_vtable.other_event(event, xevent, window);
@@ -3638,61 +3832,6 @@ _g_mbtowc (wchar_t *wstr, const char *str, size_t len)
 
 #endif /* X_LOCALE */
 
-/* 
- * used for debugging only 
- */
-#ifdef DEBUG_DND
-static void
-gdk_print_atom (GdkAtom anatom)
-{
-  gchar *tmpstr = NULL;
-  tmpstr = (anatom!=None)?gdk_atom_name(anatom):"(none)";
-  g_message("Atom %lu has name %s", anatom, tmpstr);
-  if(tmpstr)
-    g_free(tmpstr);
-}
-#endif
-
-#ifdef WE_HAVE_MOTIF_DROPS_DONE
-static GdkWindow *
-gdk_drop_get_real_window (GdkWindow   *w, 
-                         guint16     *x, 
-                         guint16     *y)
-{
-  GdkWindow *retval = w;
-  GdkWindowPrivate *awin;
-  GList *children;
-  gint16 myx = *x, myy = *y;
-  
-  g_return_val_if_fail (w != NULL && x != NULL && y != NULL, NULL);
-  
-  myx = *x; 
-  myy = *y;
-  
- descend:
-  for (children = gdk_window_get_children(retval); 
-       children && children->next;
-       children = children->next)
-    {
-      awin = (GdkWindowPrivate *) children->data;
-      if ((myx >= awin->x) && (myy >= awin->y)
-         && (myx < (awin->x + awin->width))
-         && (myy < (awin->y + awin->height)))
-       {
-         retval = (GdkWindow *) awin;
-         myx -= awin->x;
-         myy -= awin->y;
-         goto descend;
-       }
-    }
-  
-  *x = myx; 
-  *y = myy;
-  
-  return retval;
-}
-#endif
-
 /* Sends a ClientMessage to all toplevel client windows */
 gboolean
 gdk_event_send_client_message (GdkEvent *event, guint32 xid)
@@ -3716,7 +3855,7 @@ gdk_event_send_client_message (GdkEvent *event, guint32 xid)
 gboolean
 gdk_event_send_client_message_to_all_recurse (XEvent  *xev, 
                                              guint32  xid,
-                                             gboolean send_anyways)
+                                             guint    level)
 {
   static GdkAtom wm_state_atom = GDK_NONE;
 
@@ -3729,7 +3868,7 @@ gdk_event_send_client_message_to_all_recurse (XEvent  *xev,
   unsigned int ret_nchildren;
   int i;
   
-  gboolean send = TRUE;
+  gboolean send = FALSE;
   gboolean found = FALSE;
 
   if (!wm_state_atom)
@@ -3761,13 +3900,13 @@ gdk_event_send_client_message_to_all_recurse (XEvent  *xev,
        return FALSE;
 
       for(i = 0; i < ret_nchildren; i++)
-       if (gdk_event_send_client_message_to_all_recurse(xev, ret_children[i], FALSE))
+       if (gdk_event_send_client_message_to_all_recurse(xev, ret_children[i], level + 1))
          found = TRUE;
 
       XFree(ret_children);
     }
 
-  if (send || (!found && send_anyways))
+  if (send || (!found && (level == 1)))
     {
       xev->xclient.window = xid;
       gdk_send_xevent (xid, False, NoEventMask, xev);
@@ -3791,7 +3930,7 @@ gdk_event_send_clientmessage_toall (GdkEvent *event)
   memcpy(&sev.xclient.data, &event->client.data, sizeof(sev.xclient.data));
   sev.xclient.message_type = event->client.message_type;
 
-  gdk_event_send_client_message_to_all_recurse(&sev, gdk_root_window, TRUE);
+  gdk_event_send_client_message_to_all_recurse(&sev, gdk_root_window, 0);
 
   gdk_error_warnings = old_warnings;
 }
index 3df6ac8ac19a24e579671e3981fa83336305711a..002696b8729116e1905d156504ac0a3d63976d60 100644 (file)
@@ -58,6 +58,7 @@ int event_mask_table[20] =
   SubstructureNotifyMask
 };
 
+static gboolean gdk_window_have_shape_ext (void);
 
 /* internal function created for and used by gdk_window_xid_at_coords */
 Window
@@ -285,14 +286,6 @@ gdk_window_new (GdkWindow     *parent,
   private->height = (attributes->height > 1) ? (attributes->height) : (1);
   private->window_type = attributes->window_type;
   private->extension_events = FALSE;
-  private->dnd_drag_data_type = None;
-  private->dnd_drag_data_typesavail =
-    private->dnd_drop_data_typesavail = NULL;
-  private->dnd_drop_enabled = private->dnd_drag_enabled =
-    private->dnd_drag_accepted = private->dnd_drag_datashow =
-    private->dnd_drop_data_numtypesavail =
-    private->dnd_drag_data_numtypesavail = 0;
-  private->dnd_drag_eventmask = private->dnd_drag_savedeventmask = 0;
 
   private->filters = NULL;
   private->children = NULL;
@@ -506,15 +499,6 @@ gdk_window_foreign_new (guint32 anid)
 
   private->colormap = NULL;
 
-  private->dnd_drag_data_type = None;
-  private->dnd_drag_data_typesavail =
-    private->dnd_drop_data_typesavail = NULL;
-  private->dnd_drop_enabled = private->dnd_drag_enabled =
-    private->dnd_drag_accepted = private->dnd_drag_datashow =
-    private->dnd_drop_data_numtypesavail =
-    private->dnd_drag_data_numtypesavail = 0;
-  private->dnd_drag_eventmask = private->dnd_drag_savedeventmask = 0;
-
   private->filters = NULL;
   private->children = NULL;
 
@@ -584,17 +568,6 @@ gdk_window_internal_destroy (GdkWindow *window, gboolean xdestroy,
          if (private->extension_events != 0)
            gdk_input_window_destroy (window);
 
-         if(private->dnd_drag_data_numtypesavail > 0) 
-           {
-             g_free (private->dnd_drag_data_typesavail);
-             private->dnd_drag_data_typesavail = NULL;
-           }
-         if(private->dnd_drop_data_numtypesavail > 0) 
-           {
-             g_free (private->dnd_drop_data_typesavail);
-             private->dnd_drop_data_typesavail = NULL;
-           }
-
          if (private->filters)
            {
              tmp = private->filters;
@@ -1629,6 +1602,24 @@ gdk_window_add_colormap_windows (GdkWindow *window)
     XFree (old_windows);
 }
 
+static gboolean
+gdk_window_have_shape_ext (void)
+{
+  enum { UNKNOWN, NO, YES };
+  static gint have_shape = UNKNOWN;
+
+  if (have_shape == UNKNOWN)
+    {
+      int ignore;
+      if (XQueryExtension(gdk_display, "SHAPE", &ignore, &ignore, &ignore))
+       have_shape = YES;
+      else
+       have_shape = NO;
+    }
+
+  return (have_shape == YES);
+}
+
 /*
  * This needs the X11 shape extension.
  * If not available, shaped windows will look
@@ -1639,31 +1630,18 @@ gdk_window_shape_combine_mask (GdkWindow *window,
                               GdkBitmap *mask,
                               gint x, gint y)
 {
-  enum { UNKNOWN, NO, YES };
-
-  static gint have_shape = UNKNOWN;
-
   GdkWindowPrivate *window_private;
   Pixmap pixmap;
 
   g_return_if_fail (window != NULL);
 
 #ifdef HAVE_SHAPE_EXT
-  if (have_shape == UNKNOWN)
-    {
-      int ignore;
-      if (XQueryExtension(gdk_display, "SHAPE", &ignore, &ignore, &ignore))
-       have_shape = YES;
-      else
-       have_shape = NO;
-    }
-  
-  if (have_shape == YES)
+  window_private = (GdkWindowPrivate*) window;
+  if (window_private->destroyed)
+    return;
+
+  if (gdk_window_have_shape_ext())
     {
-      window_private = (GdkWindowPrivate*) window;
-      if (window_private->destroyed)
-       return;
-      
       if (mask)
        {
          GdkWindowPrivate *pixmap_private;
@@ -1960,6 +1938,344 @@ gdk_window_get_toplevels (void)
   return new_list;
 }
 
+/* 
+ * propagate the shapes from all child windows of a GDK window to the parent 
+ * window. Shamelessly ripped from Enlightenment's code
+ * 
+ * - Raster
+ */
+
+struct _gdk_span
+{
+   gint                start;
+   gint                end;
+   struct _gdk_span    *next;
+};
+
+static void
+gdk_add_to_span(struct _gdk_span **s, int x, int xx)
+{
+   struct _gdk_span   *ptr1, *ptr2, *noo, *ss;
+   gchar               spanning;
+   
+   ptr2 = NULL;
+   ptr1 = *s;
+   spanning = 0;
+   ss = NULL;
+   /* scan the spans for this line */
+   while (ptr1)
+     {
+       /* -- -> new span */
+       /* == -> existing span */
+       /* ## -> spans intersect */
+       /* if we are in the middle of spanning the span into the line */
+       if (spanning)
+         {
+            /* case: ---- ==== */
+            if (xx < ptr1->start - 1)
+              {
+                 /* ends before next span - extend to here */
+                 ss->end = xx;
+                 return;
+              }
+            /* case: ----##=== */
+            else if (xx <= ptr1->end)
+              {
+                 /* crosses into next span - delete next span and append */
+                 ss->end = ptr1->end;
+                 ss->next = ptr1->next;
+                 g_free(ptr1);
+                 return;
+              }
+            /* case: ---###--- */
+            else
+              {
+                 /* overlaps next span - delete and keep checking */
+                 ss->next = ptr1->next;
+                 g_free(ptr1);
+                 ptr1 = ss;
+              }
+         }
+       /* otherwise havent started spanning it in yet */
+       else
+         {
+            /* case: ---- ==== */
+            if (xx < ptr1->start - 1)
+              {
+                 /* insert span here in list */
+                 noo = g_malloc(sizeof(struct _gdk_span));
+                 
+                 if (noo)
+                   {
+                      noo->start = x;
+                      noo->end = xx;
+                      noo->next = ptr1;
+                      if (ptr2)
+                        ptr2->next = noo;
+                      else
+                        *s = noo;
+                   }
+                 return;
+              }
+            /* case: ----##=== */
+            else if ((x < ptr1->start) && (xx <= ptr1->end))
+              {
+                 /* expand this span to the left point of the new one */
+                 ptr1->start = x;
+                 return;
+              }
+            /* case: ===###=== */
+            else if ((x >= ptr1->start) && (xx <= ptr1->end))
+              {
+                 /* throw the span away */
+                 return;
+              }
+            /* case: ---###--- */
+            else if ((x < ptr1->start) && (xx > ptr1->end))
+              {
+                 ss = ptr1;
+                 spanning = 1;
+                 ptr1->start = x;
+                 ptr1->end = xx;
+              }
+            /* case: ===##---- */
+            else if ((x >= ptr1->start) && (x <= ptr1->end + 1) && (xx > ptr1->end))
+              {
+                 ss = ptr1;
+                 spanning = 1;
+                 ptr1->end = xx;
+              }
+            /* case: ==== ---- */
+            /* case handled by next loop iteration - first case */
+         }
+       ptr2 = ptr1;
+       ptr1 = ptr1->next;
+     }
+   /* it started in the middle but spans beyond your current list */
+   if (spanning)
+     {
+       ptr2->end = xx;
+       return;
+     }
+   /* it does not start inside a span or in the middle, so add it to the end */
+   noo = g_malloc(sizeof(struct _gdk_span));
+   
+   if (noo)
+     {
+       noo->start = x;
+       noo->end = xx;
+       if (ptr2)
+         {
+            noo->next = ptr2->next;
+            ptr2->next = noo;
+         }
+       else
+         {
+            noo->next = NULL;
+            *s = noo;
+         }
+     }
+   return;
+}
+
+static void
+gdk_add_rectangles (Display *disp, Window win, struct _gdk_span **spans,
+                   gint basew, gint baseh, gint x, gint y)
+{
+  gint a, k;
+  gint x1, y1, x2, y2;
+  gint rn, ord;
+  XRectangle *rl;
+
+  rl = XShapeGetRectangles(disp, win, ShapeBounding, &rn, &ord);
+  if (rl)
+    {
+      /* go through all clip rects in this window's shape */
+      for (k = 0; k < rn; k++)
+       {
+         /* for each clip rect, add it to each line's spans */
+         x1 = x + rl[k].x;
+         x2 = x + rl[k].x + (rl[k].width - 1);
+         y1 = y + rl[k].y;
+         y2 = y + rl[k].y + (rl[k].height - 1);
+         if (x1 < 0)
+           x1 = 0;
+         if (y1 < 0)
+           y1 = 0;
+         if (x2 >= basew)
+           x2 = basew - 1;
+         if (y2 >= baseh)
+           y2 = baseh - 1;
+         for (a = y1; a <= y2; a++)
+           {
+             if ((x2 - x1) >= 0)
+               gdk_add_to_span(&spans[a], x1, x2);
+           }
+       }
+      XFree(rl);
+    }
+}
+
+static void
+gdk_propagate_shapes(Display *disp, Window win, gboolean merge)
+{
+   Window              rt, par, *list = NULL;
+   gint                i, j, num = 0, num_rects = 0;
+   gint                x, y, contig;
+   guint               w, h, d;
+   gint                baseh, basew;
+   XRectangle         *rects = NULL;
+   struct _gdk_span  **spans = NULL, *ptr1, *ptr2, *ptr3;
+   XWindowAttributes   xatt;
+   
+   XGetGeometry(disp, win, &rt, &x, &y, &w, &h, &d, &d);
+   if (h <= 0)
+     return;
+   basew = w;
+   baseh = h;
+   spans = g_malloc(sizeof(struct _gdk_span *) * h);
+   
+   for (i = 0; i < h; i++)
+     spans[i] = NULL;
+   XQueryTree(disp, win, &rt, &par, &list, (unsigned int *)&num);
+   if (list)
+     {
+       /* go through all child windows and create/insert spans */
+       for (i = 0; i < num; i++)
+         {
+            if (XGetWindowAttributes(disp, list[i], &xatt) && (xatt.map_state != IsUnmapped))
+              if (XGetGeometry(disp, list[i], &rt, &x, &y, &w, &h, &d, &d))
+                gdk_add_rectangles (disp, list[i], spans, basew, baseh, x, y);
+         }
+       if (merge)
+         gdk_add_rectangles (disp, win, spans, basew, baseh, x, y);
+
+       /* go through the spans list and build a list of rects */
+       rects = g_malloc(sizeof(XRectangle) * 256);
+       num_rects = 0;
+       for (i = 0; i < baseh; i++)
+         {
+            ptr1 = spans[i];
+            /* go through the line for all spans */
+            while (ptr1)
+              {
+                 rects[num_rects].x = ptr1->start;
+                 rects[num_rects].y = i;
+                 rects[num_rects].width = ptr1->end - ptr1->start + 1;
+                 rects[num_rects].height = 1;
+                 j = i + 1;
+                 /* if there are more lines */
+                 contig = 1;
+                 /* while contigous rects (same start/end coords) exist */
+                 while ((contig) && (j < baseh))
+                   {
+                      /* search next line for spans matching this one */
+                      contig = 0;
+                      ptr2 = spans[j];
+                      ptr3 = NULL;
+                      while (ptr2)
+                        {
+                           /* if we have an exact span match set contig */
+                           if ((ptr2->start == ptr1->start) &&
+                               (ptr2->end == ptr1->end))
+                             {
+                                contig = 1;
+                                /* remove the span - not needed */
+                                if (ptr3)
+                                  {
+                                     ptr3->next = ptr2->next;
+                                     g_free(ptr2);
+                                     ptr2 = NULL;
+                                  }
+                                else
+                                  {
+                                     spans[j] = ptr2->next;
+                                     g_free(ptr2);
+                                     ptr2 = NULL;
+                                  }
+                                break;
+                             }
+                           /* gone past the span point no point looking */
+                           else if (ptr2->start < ptr1->start)
+                             break;
+                           if (ptr2)
+                             {
+                                ptr3 = ptr2;
+                                ptr2 = ptr2->next;
+                             }
+                        }
+                      /* if a contiguous span was found increase the rect h */
+                      if (contig)
+                        {
+                           rects[num_rects].height++;
+                           j++;
+                        }
+                   }
+                 /* up the rect count */
+                 num_rects++;
+                 /* every 256 new rects increase the rect array */
+                 if ((num_rects % 256) == 0)
+                   rects = g_realloc(rects, sizeof(XRectangle) * (num_rects + 256));
+                 ptr1 = ptr1->next;
+              }
+         }
+       /* set the rects as the shape mask */
+       if (rects)
+         {
+            XShapeCombineRectangles(disp, win, ShapeBounding, 0, 0, rects, num_rects,
+                                    ShapeSet, YXSorted);
+            g_free(rects);
+         }
+       XFree(list);
+     }
+   /* free up all the spans we made */
+   for (i = 0; i < baseh; i++)
+     {
+       ptr1 = spans[i];
+       while (ptr1)
+         {
+            ptr2 = ptr1;
+            ptr1 = ptr1->next;
+            g_free(ptr2);
+         }
+     }
+   g_free(spans);
+}
+
+void
+gdk_window_set_child_shapes (GdkWindow *window)
+{
+  GdkWindowPrivate *private;
+   
+  g_return_if_fail (window != NULL);
+   
+#ifdef HAVE_SHAPE_EXT
+  private = (GdkWindowPrivate*) window;
+  if (private->destroyed)
+    return;
+
+  if (gdk_window_have_shape_ext())
+    gdk_propagate_shapes (private->xdisplay, private->xwindow, FALSE);
+#endif   
+}
+
+void
+gdk_window_merge_child_shapes (GdkWindow *window)
+{
+  GdkWindowPrivate *private;
+  
+  g_return_if_fail (window != NULL);
+  
+#ifdef HAVE_SHAPE_EXT
+  private = (GdkWindowPrivate*) window;
+  if (private->destroyed)
+    return;
+
+  if (gdk_window_have_shape_ext())
+    gdk_propagate_shapes (private->xdisplay, private->xwindow, TRUE);
+#endif   
+}
+
 void          
 gdk_drawable_set_data (GdkDrawable   *drawable,
                       const gchar   *key,
index 7ce7310c55b5cc4ad9b3a89a38ad0d2dad931b17..d2802d55ec9298ca48fbe75c1b5e0e89f0b44ff8 100644 (file)
@@ -5,7 +5,7 @@ DEFS += -DG_LOG_DOMAIN=\"Gtk\"
 
 lib_LTLIBRARIES = libgtk.la
 
-libgtk_la_SOURCES = \
+static_sources = \
        gtkaccelgroup.c         \
        gtkaccellabel.c         \
        gtkadjustment.c         \
@@ -31,6 +31,7 @@ libgtk_la_SOURCES = \
        gtkdialog.c             \
        gtkdnd.c                \
        gtkdrawingarea.c        \
+       gtkdrawwindow.c         \
        gtkeditable.c           \
        gtkentry.c              \
        gtkeventbox.c           \
@@ -57,7 +58,6 @@ libgtk_la_SOURCES = \
        gtklist.c               \
        gtklistitem.c           \
        gtkmain.c               \
-       gtkmarshal.c            \
        gtkmenu.c               \
        gtkmenubar.c            \
        gtkmenufactory.c        \
@@ -90,6 +90,7 @@ libgtk_la_SOURCES = \
        gtktable.c              \
        gtktearoffmenuitem.c    \
        gtktext.c               \
+       gtkthemes.c             \
        gtktipsquery.c          \
        gtktogglebutton.c       \
        gtktoolbar.c            \
@@ -110,6 +111,10 @@ libgtk_la_SOURCES = \
        fnmatch.c               \
        fnmatch.h
 
+libgtk_la_SOURCES = \
+       $(static_sources)       \
+       gtkmarshal.c
+
 # Source headers are are non-autogenerated headers
 source_headers = \
        gtk.h                   \
@@ -139,6 +144,7 @@ source_headers = \
        gtkdialog.h             \
        gtkdnd.h                \
        gtkdrawingarea.h        \
+       gtkdrawwindow.h         \
        gtkeditable.h           \
        gtkentry.h              \
        gtkenums.h              \
@@ -199,6 +205,7 @@ source_headers = \
        gtktable.h              \
        gtktearoffmenuitem.h    \
        gtktext.h               \
+       gtkthemes.h             \
        gtktipsquery.h          \
        gtktogglebutton.h       \
        gtktoolbar.h            \
@@ -232,7 +239,7 @@ BUILT_SOURCES = \
         gtkmarshal.h 
 
 # cause the built sources to be rebuild when possible, even with --include-deps
-$(libgtk_la_SOURCES): $(BUILT_SOURCES)
+$(static_sources): $(BUILT_SOURCES)
 
 # More headers to use when autogenerating.
 gdk_headers = \
@@ -307,12 +314,13 @@ EXTRA_DIST = \
        tree_minus.xbm          \
         circles.xbm
 
-INCLUDES = -I$(top_srcdir) @GLIB_CFLAGS@ @x_cflags@
+INCLUDES = \
+       -DGTK_EXE_PREFIX=\"$(exec_prefix)\"   \
+       -DGTK_DATA_PREFIX=\"$(prefix)\"   \
+       -I$(top_srcdir) @GLIB_CFLAGS@ @x_cflags@
 
 noinst_PROGRAMS = testgtk testinput testselection testthreads testrgb testdnd simple 
 
-# FIXME, we currently rely on linking against libglib-1.1
-
 DEPS = \
        libgtk.la                                       \
        $(top_builddir)/gdk/libgdk.la
diff --git a/gtk/Makefile.in b/gtk/Makefile.in
deleted file mode 100644 (file)
index 48cc410..0000000
+++ /dev/null
@@ -1,712 +0,0 @@
-# Makefile.in generated automatically by automake 1.3 from Makefile.am
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-
-DISTDIR =
-
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-
-top_builddir = ..
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-host_alias = @host_alias@
-host_triplet = @host@
-CC = @CC@
-GTK_MAJOR_VERSION = @GTK_MAJOR_VERSION@
-GTK_MICRO_VERSION = @GTK_MICRO_VERSION@
-GTK_MINOR_VERSION = @GTK_MINOR_VERSION@
-GTK_VERSION = @GTK_VERSION@
-LD = @LD@
-LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-LT_AGE = @LT_AGE@
-LT_CURRENT = @LT_CURRENT@
-LT_RELEASE = @LT_RELEASE@
-LT_REVISION = @LT_REVISION@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-NM = @NM@
-PACKAGE = @PACKAGE@
-RANLIB = @RANLIB@
-VERSION = @VERSION@
-x_cflags = @x_cflags@
-x_includes = @x_includes@
-x_ldflags = @x_ldflags@
-x_libs = @x_libs@
-xinput_progs = @xinput_progs@
-
-gtkincludedir = $(includedir)/gtk
-
-lib_LTLIBRARIES = libgtk-1.1.la
-
-libgtk_1_1_la_SOURCES = \
-       gtkaccelerator.c        \
-       gtkadjustment.c         \
-       gtkaspectframe.c        \
-       gtkalignment.c          \
-       gtkarrow.c              \
-       gtkbin.c                \
-       gtkbbox.c               \
-       gtkbox.c                \
-       gtkbutton.c             \
-       gtkcheckbutton.c        \
-       gtkcheckmenuitem.c      \
-       gtkclist.c              \
-       gtkcolorsel.c           \
-       gtkcombo.c              \
-       gtkcontainer.c          \
-       gtkctree.c              \
-       gtkcurve.c              \
-       gtkdata.c               \
-       gtkdialog.c             \
-       gtkdrawingarea.c        \
-       gtkeditable.c           \
-       gtkentry.c              \
-       gtkeventbox.c           \
-       gtkfilesel.c            \
-       gtkfixed.c              \
-       gtkframe.c              \
-       gtkgamma.c              \
-       gtkgc.c                 \
-       gtkhandlebox.c          \
-       gtkhbbox.c              \
-       gtkhbox.c               \
-       gtkhpaned.c             \
-       gtkhruler.c             \
-       gtkhscale.c             \
-       gtkhscrollbar.c         \
-       gtkhseparator.c         \
-       gtkimage.c              \
-       gtkinputdialog.c        \
-       gtkitem.c               \
-       gtklabel.c              \
-       gtklist.c               \
-       gtklistitem.c           \
-       gtkmain.c               \
-       gtkmenu.c               \
-       gtkmenubar.c            \
-       gtkmenufactory.c        \
-       gtkmenuitem.c           \
-       gtkmenushell.c          \
-       gtkmisc.c               \
-       gtknotebook.c           \
-       gtkobject.c             \
-       gtkoptionmenu.c         \
-       gtkpaned.c              \
-       gtkpixmap.c             \
-       gtkpreview.c            \
-       gtkprogressbar.c        \
-       gtkradiobutton.c        \
-       gtkradiomenuitem.c      \
-       gtkrange.c              \
-       gtkrc.c                 \
-       gtkruler.c              \
-       gtkscale.c              \
-       gtkscrollbar.c          \
-       gtkscrolledwindow.c     \
-       gtkselection.c          \
-       gtkseparator.c          \
-       gtksignal.c             \
-       gtkspinbutton.c         \
-       gtkstyle.c              \
-       gtkstatusbar.c          \
-       gtktable.c              \
-       gtktext.c               \
-       gtktipsquery.c          \
-       gtktogglebutton.c       \
-       gtktoolbar.c            \
-       gtktooltips.c           \
-       gtktree.c               \
-       gtktreeitem.c           \
-       gtktypeutils.c          \
-       gtkvbbox.c              \
-       gtkvbox.c               \
-       gtkviewport.c           \
-       gtkvpaned.c             \
-       gtkvruler.c             \
-       gtkvscale.c             \
-       gtkvscrollbar.c         \
-       gtkvseparator.c         \
-       gtkwidget.c             \
-       gtkwindow.c             \
-       fnmatch.c               \
-       fnmatch.h
-
-gtkinclude_HEADERS = \
-       gtk.h                   \
-       gtkaccelerator.h        \
-       gtkadjustment.h         \
-       gtkaspectframe.h        \
-       gtkalignment.h          \
-       gtkarrow.h              \
-       gtkbin.h                \
-       gtkbbox.h               \
-       gtkbox.h                \
-       gtkbutton.h             \
-       gtkcheckbutton.h        \
-       gtkcheckmenuitem.h      \
-       gtkclist.h              \
-       gtkcolorsel.h           \
-       gtkcombo.h              \
-       gtkcontainer.h          \
-       gtkctree.h              \
-       gtkcurve.h              \
-       gtkdata.h               \
-       gtkdebug.h              \
-       gtkdialog.h             \
-       gtkdrawingarea.h        \
-       gtkeditable.h           \
-       gtkentry.h              \
-       gtkenums.h              \
-       gtkeventbox.h           \
-       gtkfeatures.h           \
-       gtkfilesel.h            \
-       gtkfixed.h              \
-       gtkframe.h              \
-       gtkgamma.h              \
-       gtkgc.h                 \
-       gtkhandlebox.h          \
-       gtkhbbox.h              \
-       gtkhbox.h               \
-       gtkhpaned.h             \
-       gtkhruler.h             \
-       gtkhscale.h             \
-       gtkhscrollbar.h         \
-       gtkhseparator.h         \
-       gtkimage.h              \
-       gtkinputdialog.h        \
-       gtkitem.h               \
-       gtklabel.h              \
-       gtklist.h               \
-       gtklistitem.h           \
-       gtkmain.h               \
-       gtkmenu.h               \
-       gtkmenubar.h            \
-       gtkmenufactory.h        \
-       gtkmenuitem.h           \
-       gtkmenushell.h          \
-       gtkmisc.h               \
-       gtknotebook.h           \
-       gtkobject.h             \
-       gtkoptionmenu.h         \
-       gtkpaned.h              \
-       gtkpixmap.h             \
-       gtkpreview.h            \
-       gtkprivate.h            \
-       gtkprogressbar.h        \
-       gtkradiobutton.h        \
-       gtkradiomenuitem.h      \
-       gtkrange.h              \
-       gtkrc.h                 \
-       gtkruler.h              \
-       gtkscale.h              \
-       gtkscrollbar.h          \
-       gtkscrolledwindow.h     \
-       gtkselection.h          \
-       gtkseparator.h          \
-       gtksignal.h             \
-       gtkspinbutton.h         \
-       gtkstyle.h              \
-       gtkstatusbar.h          \
-       gtktable.h              \
-       gtktext.h               \
-       gtktipsquery.h          \
-       gtktogglebutton.h       \
-       gtktoolbar.h            \
-       gtktooltips.h           \
-       gtktree.h               \
-       gtktreeitem.h           \
-       gtktypeutils.h          \
-       gtkvbbox.h              \
-       gtkvbox.h               \
-       gtkviewport.h           \
-       gtkvpaned.h             \
-       gtkvruler.h             \
-       gtkvscale.h             \
-       gtkvscrollbar.h         \
-       gtkvseparator.h         \
-       gtkwidget.h             \
-       gtkwindow.h             \
-       gtktypebuiltins.h
-
-libgtk_1_1_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
-
-EXTRA_DIST = \
-       line-arrow.xbm          \
-       line-wrap.xbm           \
-       testgtkrc               \
-       testgtkrc2              \
-       gtk.defs                \
-       gtkfeatures.h.in        \
-       runelisp                \
-       gentypeinfo.el          \
-       gtktypebuiltins.c       \
-       test.xpm                \
-       marble.xpm              \
-       3DRings.xpm             \
-       FilesQueue.xpm          \
-       Modeller.xpm            \
-       tree_plus.xpm           \
-       tree_minus.xpm          \
-       tree_plus.xbm           \
-       tree_minus.xbm          \
-        circles.xbm
-
-INCLUDES = -I$(top_srcdir) -I../glib -I$(top_srcdir)/glib @x_cflags@ 
-
-noinst_PROGRAMS = testgtk testinput testselection testthreads simple 
-
-# FIXME, we currently rely on linking against libglib-1.1
-
-DEPS = \
-       libgtk-@LT_RELEASE@.la                          \
-       $(top_builddir)/gdk/libgdk-@LT_RELEASE@.la      \
-       $(top_builddir)/glib/libglib-1.1.la
-LDADDS = \
-       libgtk-@LT_RELEASE@.la                          \
-       $(top_builddir)/gdk/libgdk-@LT_RELEASE@.la      \
-       @x_ldflags@                                     \
-       @x_libs@                                        \
-       $(top_builddir)/glib/libglib-1.1.la             \
-       -lm
-
-testgtk_DEPENDENCIES = $(DEPS)
-testinput_DEPENDENCIES = $(DEPS)
-testthreads_DEPENDENCIES = $(DEPS)
-testselection_DEPENDENCIES = $(DEPS)
-simple_DEPENDENCIES = $(DEPS)
-
-testgtk_LDADD = $(LDADDS)
-testinput_LDADD = $(LDADDS)
-testthreads_LDADD = $(LDADDS)
-testselection_LDADD = $(LDADDS)
-simple_LDADD = $(LDADDS)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = ../config.h
-CONFIG_CLEAN_FILES =  gtkfeatures.h
-LTLIBRARIES =  $(lib_LTLIBRARIES)
-
-
-DEFS = @DEFS@ -I. -I$(srcdir) -I..
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-X_CFLAGS = @X_CFLAGS@
-X_LIBS = @X_LIBS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
-libgtk_1_1_la_LIBADD = 
-libgtk_1_1_la_OBJECTS =  gtkaccelerator.lo gtkadjustment.lo \
-gtkaspectframe.lo gtkalignment.lo gtkarrow.lo gtkbin.lo gtkbbox.lo \
-gtkbox.lo gtkbutton.lo gtkcheckbutton.lo gtkcheckmenuitem.lo \
-gtkclist.lo gtkcolorsel.lo gtkcombo.lo gtkcontainer.lo gtkctree.lo \
-gtkcurve.lo gtkdata.lo gtkdialog.lo gtkdrawingarea.lo gtkeditable.lo \
-gtkentry.lo gtkeventbox.lo gtkfilesel.lo gtkfixed.lo gtkframe.lo \
-gtkgamma.lo gtkgc.lo gtkhandlebox.lo gtkhbbox.lo gtkhbox.lo \
-gtkhpaned.lo gtkhruler.lo gtkhscale.lo gtkhscrollbar.lo \
-gtkhseparator.lo gtkimage.lo gtkinputdialog.lo gtkitem.lo gtklabel.lo \
-gtklist.lo gtklistitem.lo gtkmain.lo gtkmenu.lo gtkmenubar.lo \
-gtkmenufactory.lo gtkmenuitem.lo gtkmenushell.lo gtkmisc.lo \
-gtknotebook.lo gtkobject.lo gtkoptionmenu.lo gtkpaned.lo gtkpixmap.lo \
-gtkpreview.lo gtkprogressbar.lo gtkradiobutton.lo gtkradiomenuitem.lo \
-gtkrange.lo gtkrc.lo gtkruler.lo gtkscale.lo gtkscrollbar.lo \
-gtkscrolledwindow.lo gtkselection.lo gtkseparator.lo gtksignal.lo \
-gtkspinbutton.lo gtkstyle.lo gtkstatusbar.lo gtktable.lo gtktext.lo \
-gtktipsquery.lo gtktogglebutton.lo gtktoolbar.lo gtktooltips.lo \
-gtktree.lo gtktreeitem.lo gtktypeutils.lo gtkvbbox.lo gtkvbox.lo \
-gtkviewport.lo gtkvpaned.lo gtkvruler.lo gtkvscale.lo gtkvscrollbar.lo \
-gtkvseparator.lo gtkwidget.lo gtkwindow.lo fnmatch.lo
-PROGRAMS =  $(noinst_PROGRAMS)
-
-testgtk_SOURCES = testgtk.c
-testgtk_OBJECTS =  testgtk.o
-testgtk_LDFLAGS = 
-testinput_SOURCES = testinput.c
-testinput_OBJECTS =  testinput.o
-testinput_LDFLAGS = 
-testselection_SOURCES = testselection.c
-testselection_OBJECTS =  testselection.o
-testselection_LDFLAGS = 
-testthreads_SOURCES = testthreads.c
-testthreads_OBJECTS =  testthreads.o
-testthreads_LDFLAGS = 
-simple_SOURCES = simple.c
-simple_OBJECTS =  simple.o
-simple_LDFLAGS = 
-CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
-HEADERS =  $(gtkinclude_HEADERS)
-
-DIST_COMMON =  Makefile.am Makefile.in gtkfeatures.h.in
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-TAR = tar
-GZIP = --best
-DEP_FILES =  .deps/fnmatch.P .deps/gtkaccelerator.P \
-.deps/gtkadjustment.P .deps/gtkalignment.P .deps/gtkarrow.P \
-.deps/gtkaspectframe.P .deps/gtkbbox.P .deps/gtkbin.P .deps/gtkbox.P \
-.deps/gtkbutton.P .deps/gtkcheckbutton.P .deps/gtkcheckmenuitem.P \
-.deps/gtkclist.P .deps/gtkcolorsel.P .deps/gtkcombo.P \
-.deps/gtkcontainer.P .deps/gtkctree.P .deps/gtkcurve.P .deps/gtkdata.P \
-.deps/gtkdialog.P .deps/gtkdrawingarea.P .deps/gtkeditable.P \
-.deps/gtkentry.P .deps/gtkeventbox.P .deps/gtkfilesel.P \
-.deps/gtkfixed.P .deps/gtkframe.P .deps/gtkgamma.P .deps/gtkgc.P \
-.deps/gtkhandlebox.P .deps/gtkhbbox.P .deps/gtkhbox.P .deps/gtkhpaned.P \
-.deps/gtkhruler.P .deps/gtkhscale.P .deps/gtkhscrollbar.P \
-.deps/gtkhseparator.P .deps/gtkimage.P .deps/gtkinputdialog.P \
-.deps/gtkitem.P .deps/gtklabel.P .deps/gtklist.P .deps/gtklistitem.P \
-.deps/gtkmain.P .deps/gtkmenu.P .deps/gtkmenubar.P \
-.deps/gtkmenufactory.P .deps/gtkmenuitem.P .deps/gtkmenushell.P \
-.deps/gtkmisc.P .deps/gtknotebook.P .deps/gtkobject.P \
-.deps/gtkoptionmenu.P .deps/gtkpaned.P .deps/gtkpixmap.P \
-.deps/gtkpreview.P .deps/gtkprogressbar.P .deps/gtkradiobutton.P \
-.deps/gtkradiomenuitem.P .deps/gtkrange.P .deps/gtkrc.P \
-.deps/gtkruler.P .deps/gtkscale.P .deps/gtkscrollbar.P \
-.deps/gtkscrolledwindow.P .deps/gtkselection.P .deps/gtkseparator.P \
-.deps/gtksignal.P .deps/gtkspinbutton.P .deps/gtkstatusbar.P \
-.deps/gtkstyle.P .deps/gtktable.P .deps/gtktext.P .deps/gtktipsquery.P \
-.deps/gtktogglebutton.P .deps/gtktoolbar.P .deps/gtktooltips.P \
-.deps/gtktree.P .deps/gtktreeitem.P .deps/gtktypeutils.P \
-.deps/gtkvbbox.P .deps/gtkvbox.P .deps/gtkviewport.P .deps/gtkvpaned.P \
-.deps/gtkvruler.P .deps/gtkvscale.P .deps/gtkvscrollbar.P \
-.deps/gtkvseparator.P .deps/gtkwidget.P .deps/gtkwindow.P \
-.deps/simple.P .deps/testgtk.P .deps/testinput.P .deps/testselection.P \
-.deps/testthreads.P
-SOURCES = $(libgtk_1_1_la_SOURCES) testgtk.c testinput.c testselection.c testthreads.c simple.c
-OBJECTS = $(libgtk_1_1_la_OBJECTS) testgtk.o testinput.o testselection.o testthreads.o simple.o
-
-all: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS)
-
-.SUFFIXES:
-.SUFFIXES: .S .c .lo .o .s
-$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
-       cd $(top_srcdir) && $(AUTOMAKE) --gnu gtk/Makefile
-
-Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
-       cd $(top_builddir) \
-         && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-gtkfeatures.h: $(top_builddir)/config.status gtkfeatures.h.in
-       cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
-
-mostlyclean-libLTLIBRARIES:
-
-clean-libLTLIBRARIES:
-       -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-
-distclean-libLTLIBRARIES:
-
-maintainer-clean-libLTLIBRARIES:
-
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
-       @$(NORMAL_INSTALL)
-       $(mkinstalldirs) $(DESTDIR)$(libdir)
-       @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
-         if test -f $$p; then \
-           echo "$(LIBTOOL)  --mode=install $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \
-           $(LIBTOOL)  --mode=install $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \
-         else :; fi; \
-       done
-
-uninstall-libLTLIBRARIES:
-       @$(NORMAL_UNINSTALL)
-       list='$(lib_LTLIBRARIES)'; for p in $$list; do \
-         $(LIBTOOL)  --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
-       done
-
-.s.o:
-       $(COMPILE) -c $<
-
-.S.o:
-       $(COMPILE) -c $<
-
-mostlyclean-compile:
-       -rm -f *.o core *.core
-
-clean-compile:
-
-distclean-compile:
-       -rm -f *.tab.c
-
-maintainer-clean-compile:
-
-.s.lo:
-       $(LIBTOOL) --mode=compile $(COMPILE) -c $<
-
-.S.lo:
-       $(LIBTOOL) --mode=compile $(COMPILE) -c $<
-
-mostlyclean-libtool:
-       -rm -f *.lo
-
-clean-libtool:
-       -rm -rf .libs _libs
-
-distclean-libtool:
-
-maintainer-clean-libtool:
-
-libgtk-1.1.la: $(libgtk_1_1_la_OBJECTS) $(libgtk_1_1_la_DEPENDENCIES)
-       $(LINK) -rpath $(libdir) $(libgtk_1_1_la_LDFLAGS) $(libgtk_1_1_la_OBJECTS) $(libgtk_1_1_la_LIBADD) $(LIBS)
-
-mostlyclean-noinstPROGRAMS:
-
-clean-noinstPROGRAMS:
-       -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
-
-distclean-noinstPROGRAMS:
-
-maintainer-clean-noinstPROGRAMS:
-
-testgtk: $(testgtk_OBJECTS) $(testgtk_DEPENDENCIES)
-       @rm -f testgtk
-       $(LINK) $(testgtk_LDFLAGS) $(testgtk_OBJECTS) $(testgtk_LDADD) $(LIBS)
-
-testinput: $(testinput_OBJECTS) $(testinput_DEPENDENCIES)
-       @rm -f testinput
-       $(LINK) $(testinput_LDFLAGS) $(testinput_OBJECTS) $(testinput_LDADD) $(LIBS)
-
-testselection: $(testselection_OBJECTS) $(testselection_DEPENDENCIES)
-       @rm -f testselection
-       $(LINK) $(testselection_LDFLAGS) $(testselection_OBJECTS) $(testselection_LDADD) $(LIBS)
-
-testthreads: $(testthreads_OBJECTS) $(testthreads_DEPENDENCIES)
-       @rm -f testthreads
-       $(LINK) $(testthreads_LDFLAGS) $(testthreads_OBJECTS) $(testthreads_LDADD) $(LIBS)
-
-simple: $(simple_OBJECTS) $(simple_DEPENDENCIES)
-       @rm -f simple
-       $(LINK) $(simple_LDFLAGS) $(simple_OBJECTS) $(simple_LDADD) $(LIBS)
-
-install-gtkincludeHEADERS: $(gtkinclude_HEADERS)
-       @$(NORMAL_INSTALL)
-       $(mkinstalldirs) $(DESTDIR)$(gtkincludedir)
-       @list='$(gtkinclude_HEADERS)'; for p in $$list; do \
-         if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
-         echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(gtkincludedir)/$$p"; \
-         $(INSTALL_DATA) $$d$$p $(DESTDIR)$(gtkincludedir)/$$p; \
-       done
-
-uninstall-gtkincludeHEADERS:
-       @$(NORMAL_UNINSTALL)
-       list='$(gtkinclude_HEADERS)'; for p in $$list; do \
-         rm -f $(DESTDIR)$(gtkincludedir)/$$p; \
-       done
-
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP)
-       here=`pwd` && cd $(srcdir) \
-         && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) $(LISP)
-       tags=; \
-       here=`pwd`; \
-       list='$(SOURCES) $(HEADERS)'; \
-       unique=`for i in $$list; do echo $$i; done | \
-         awk '    { files[$$0] = 1; } \
-              END { for (i in files) print i; }'`; \
-       test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
-         || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags  $$unique $(LISP) -o $$here/TAGS)
-
-mostlyclean-tags:
-
-clean-tags:
-
-distclean-tags:
-       -rm -f TAGS ID
-
-maintainer-clean-tags:
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-subdir = gtk
-
-distdir: $(DISTFILES)
-       here=`cd $(top_builddir) && pwd`; \
-       top_distdir=`cd $(top_distdir) && pwd`; \
-       distdir=`cd $(distdir) && pwd`; \
-       cd $(top_srcdir) \
-         && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu gtk/Makefile
-       @for file in $(DISTFILES); do \
-         d=$(srcdir); \
-         test -f $(distdir)/$$file \
-         || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
-         || cp -p $$d/$$file $(distdir)/$$file; \
-       done
-
-DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
-
--include $(DEP_FILES)
-
-mostlyclean-depend:
-
-clean-depend:
-
-distclean-depend:
-
-maintainer-clean-depend:
-       -rm -rf .deps
-
-%.o: %.c
-       @echo '$(COMPILE) -c $<'; \
-       $(COMPILE) -Wp,-MD,.deps/$(*F).P -c $<
-
-%.lo: %.c
-       @echo '$(LTCOMPILE) -c $<'; \
-       $(LTCOMPILE) -Wp,-MD,.deps/$(*F).p -c $<
-       @-sed -e 's/^\([^:]*\)\.o:/\1.lo \1.o:/' \
-         < .deps/$(*F).p > .deps/$(*F).P
-       @-rm -f .deps/$(*F).p
-info:
-dvi:
-check: all
-       $(MAKE)
-installcheck:
-install-exec: install-libLTLIBRARIES
-       @$(NORMAL_INSTALL)
-
-install-data: install-gtkincludeHEADERS
-       @$(NORMAL_INSTALL)
-
-install: install-exec install-data all
-       @:
-
-uninstall: uninstall-libLTLIBRARIES uninstall-gtkincludeHEADERS
-
-install-strip:
-       $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
-installdirs:
-       $(mkinstalldirs)  $(DATADIR)$(libdir) $(DATADIR)$(gtkincludedir)
-
-
-mostlyclean-generic:
-       -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
-
-clean-generic:
-       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
-       -rm -f Makefile $(DISTCLEANFILES)
-       -rm -f config.cache config.log stamp-h stamp-h[0-9]*
-       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
-       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean:  mostlyclean-libLTLIBRARIES mostlyclean-compile \
-               mostlyclean-libtool mostlyclean-noinstPROGRAMS \
-               mostlyclean-tags mostlyclean-depend mostlyclean-generic
-
-clean:  clean-libLTLIBRARIES clean-compile clean-libtool \
-               clean-noinstPROGRAMS clean-tags clean-depend \
-               clean-generic mostlyclean
-
-distclean:  distclean-libLTLIBRARIES distclean-compile distclean-libtool \
-               distclean-noinstPROGRAMS distclean-tags \
-               distclean-depend distclean-generic clean
-       -rm -f config.status
-       -rm -f libtool
-
-maintainer-clean:  maintainer-clean-libLTLIBRARIES \
-               maintainer-clean-compile maintainer-clean-libtool \
-               maintainer-clean-noinstPROGRAMS maintainer-clean-tags \
-               maintainer-clean-depend maintainer-clean-generic \
-               distclean
-       @echo "This command is intended for maintainers to use;"
-       @echo "it deletes files that may require special tools to rebuild."
-
-.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
-clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
-uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \
-distclean-compile clean-compile maintainer-clean-compile \
-mostlyclean-libtool distclean-libtool clean-libtool \
-maintainer-clean-libtool mostlyclean-noinstPROGRAMS \
-distclean-noinstPROGRAMS clean-noinstPROGRAMS \
-maintainer-clean-noinstPROGRAMS uninstall-gtkincludeHEADERS \
-install-gtkincludeHEADERS tags mostlyclean-tags distclean-tags \
-clean-tags maintainer-clean-tags distdir mostlyclean-depend \
-distclean-depend clean-depend maintainer-clean-depend info dvi \
-installcheck install-exec install-data install uninstall all \
-installdirs mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
-
-
-$(srcdir)/gtktypebuiltins.h: @MAINT@ $(srcdir)/gtk.defs $(srcdir)/gentypeinfo.el
-       $(SHELL) $(srcdir)/runelisp $(srcdir)/gentypeinfo.el idmac $< $@
-
-$(srcdir)/gtktypebuiltins.c: @MAINT@ $(srcdir)/gtk.defs $(srcdir)/gentypeinfo.el
-       $(SHELL) $(srcdir)/runelisp $(srcdir)/gentypeinfo.el id $< $@
-
-.PHONY: files test test-debug
-
-files:
-       @files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
-         echo $$p; \
-       done
-
-test: testgtk
-       builddir=`pwd`; cd $(top_builddir); top_builddir=`pwd`; \
-       cd $$builddir; cd $(srcdir); \
-       $(SHELL) $$top_builddir/libtool --mode=execute $$builddir/testgtk
-
-test-debug: testgtk
-       builddir=`pwd`; cd $(top_builddir); top_builddir=`pwd`; \
-       cd $$builddir; cd $(srcdir); \
-       $(SHELL) $$top_builddir/libtool --mode=execute gdb $$builddir/testgtk
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
index 475e4b456b840f87a7d12795835d4ce35d7de071..ec1bea23a356454f939298685cbe375e525a6ae9 100755 (executable)
@@ -45,7 +45,6 @@ print OH <<EOT;
 
 #ifdef __cplusplus
 extern "C" {
-#pragma }
 #endif /* __cplusplus */
 
 #define gtk_signal_default_marshaller gtk_marshal_NONE__NONE
index 5ca83e268d01e1f5489659ea9b69b09edbb62dc1..b59c5c4937ba41c5a98592a608c7388e92652c07 100644 (file)
--- a/gtk/gtk.h
+++ b/gtk/gtk.h
@@ -46,6 +46,7 @@
 #include <gtk/gtkdialog.h>
 #include <gtk/gtkdnd.h>
 #include <gtk/gtkdrawingarea.h>
+#include <gtk/gtkdrawwindow.h>
 #include <gtk/gtkeditable.h>
 #include <gtk/gtkentry.h>
 #include <gtk/gtkenums.h>
 #include <gtk/gtktable.h>
 #include <gtk/gtktearoffmenuitem.h>
 #include <gtk/gtktext.h>
+#include <gtk/gtkthemes.h>
 #include <gtk/gtktipsquery.h>
 #include <gtk/gtktogglebutton.h>
 #include <gtk/gtktoolbar.h>
index 566b5ecc0975c4200bd476b22ab5c493212062e3..e70f649368cc860a8bc89353866c3c7dd962cad4 100644 (file)
@@ -172,14 +172,7 @@ gtk_arrow_set (GtkArrow      *arrow,
       arrow->shadow_type = shadow_type;
 
       if (GTK_WIDGET_DRAWABLE (arrow))
-       {
-         gdk_window_clear_area (GTK_WIDGET (arrow)->window,
-                                GTK_WIDGET (arrow)->allocation.x,
-                                GTK_WIDGET (arrow)->allocation.y,
-                                GTK_WIDGET (arrow)->allocation.width,
-                                GTK_WIDGET (arrow)->allocation.height);
-         gtk_widget_queue_draw (GTK_WIDGET (arrow));
-       }
+       gtk_widget_queue_clear (GTK_WIDGET (arrow));
     }
 }
 
@@ -227,9 +220,11 @@ gtk_arrow_expose (GtkWidget      *widget,
             shadow_type = GTK_SHADOW_ETCHED_IN;
        }
 
-      gtk_draw_arrow (widget->style, widget->window,
-                     widget->state, shadow_type, arrow->arrow_type, TRUE,
-                     x, y, extent, extent);
+      gtk_paint_arrow (widget->style, widget->window,
+                      widget->state, shadow_type,
+                      &event->area, widget, "arrow",
+                      arrow->arrow_type, TRUE,
+                      x, y, extent, extent);
     }
 
   return TRUE;
index fe6c76a0f8659e30437eed2d3092c8c6df039f48..2472e8b2aa4737f18136963610089677acc9561d 100644 (file)
@@ -135,11 +135,7 @@ gtk_aspect_frame_set (GtkAspectFrame *aspect_frame,
       aspect_frame->obey_child = obey_child;
 
       if (GTK_WIDGET_DRAWABLE(widget))
-       gdk_window_clear_area (widget->window,
-                              widget->allocation.x,
-                              widget->allocation.y,
-                              widget->allocation.width,
-                              widget->allocation.height);
+       gtk_widget_queue_clear (widget);
 
       gtk_widget_queue_resize (widget);
     }
@@ -152,7 +148,7 @@ gtk_aspect_frame_paint (GtkWidget    *widget,
   GtkFrame *frame;
   gint height_extra;
   gint label_area_width;
-  gint x, y;
+  gint x, y, x2, y2;
   GtkAllocation *allocation;
 
   g_return_if_fail (widget != NULL);
@@ -170,32 +166,40 @@ gtk_aspect_frame_paint (GtkWidget    *widget,
       x = GTK_CONTAINER (frame)->border_width;
       y = GTK_CONTAINER (frame)->border_width;
 
-      gtk_draw_shadow (widget->style, widget->window,
-                      GTK_STATE_NORMAL, frame->shadow_type,
-                      allocation->x + x,
-                      allocation->y + y + height_extra / 2,
-                      allocation->width - x * 2,
-                      allocation->height - y * 2 - height_extra / 2);
-
       if (frame->label)
        {
          label_area_width = (allocation->width +
                              GTK_CONTAINER (frame)->border_width * 2 -
                              widget->style->klass->xthickness * 2);
 
-         x = ((label_area_width - frame->label_width) * frame->label_xalign +
-              GTK_CONTAINER (frame)->border_width + widget->style->klass->xthickness);
-         y = (GTK_CONTAINER (frame)->border_width + widget->style->font->ascent);
-
-         gdk_window_clear_area (widget->window,
-                                allocation->x + x + 2,
-                                allocation->y + GTK_CONTAINER (frame)->border_width,
-                                frame->label_width - 4, frame->label_height);
-         gtk_draw_string (widget->style, widget->window, GTK_WIDGET_STATE (widget),
-                          allocation->x + x + 3,
-                          allocation->y + y,
-                          frame->label);
+         x2 = ((label_area_width - frame->label_width) * frame->label_xalign +
+               GTK_CONTAINER (frame)->border_width + widget->style->klass->xthickness);
+         y2 = (GTK_CONTAINER (frame)->border_width + widget->style->font->ascent);
+         
+         gtk_paint_shadow_gap (widget->style, widget->window,
+                               GTK_STATE_NORMAL, frame->shadow_type,
+                               area, widget, "frame",
+                               allocation->x + x,
+                               allocation->y + y + height_extra / 2,
+                               allocation->width - x * 2,
+                               allocation->height - y * 2 - height_extra / 2,
+                               GTK_POS_TOP, 
+                               x2 + 2 - x, frame->label_width - 4);
+         
+         gtk_paint_string (widget->style, widget->window, GTK_WIDGET_STATE (widget),
+                           area, widget, "frame",
+                           allocation->x + x2 + 3,
+                           allocation->y + y2,
+                           frame->label);
        }
+      else
+       gtk_paint_shadow (widget->style, widget->window,
+                         GTK_STATE_NORMAL, frame->shadow_type,
+                         area, widget, "frame",
+                         allocation->x + x,
+                         allocation->y + y + height_extra / 2,
+                         allocation->width - x * 2,
+                         allocation->height - y * 2 - height_extra / 2);
     }
 }
 
index 6362eb53de0a872fcfaec7b3e16fbc6f6427829f..e3bdab1fccc55da25a20943ade8bd41c95ad6e04 100644 (file)
@@ -142,11 +142,7 @@ gtk_bin_unmap (GtkWidget *widget)
   bin = GTK_BIN (widget);
 
   if (GTK_WIDGET_NO_WINDOW (widget))
-    gdk_window_clear_area (widget->window,
-                          widget->allocation.x,
-                          widget->allocation.y,
-                          widget->allocation.width,
-                          widget->allocation.height);
+     gtk_widget_queue_clear (widget);
   else
     gdk_window_hide (widget->window);
 
index 652c735aa7ba8f8b8e938c9cefdb9149d754a6cb..c092c0bb00287890eeba94727d945679a064ac2d 100644 (file)
@@ -638,20 +638,20 @@ gtk_box_draw (GtkWidget    *widget,
   GtkBoxChild *child;
   GdkRectangle child_area;
   GList *children;
-
+  
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_BOX (widget));
-
+   
   if (GTK_WIDGET_DRAWABLE (widget))
     {
       box = GTK_BOX (widget);
-
+       
       children = box->children;
       while (children)
        {
          child = children->data;
          children = children->next;
-
+            
          if (gtk_widget_intersect (child->widget, area, &child_area))
            gtk_widget_draw (child->widget, &child_area);
        }
index 1ebc69b27fdaf1d31d234a39f252fa059f3b9554..7ea658af2c1134e394b0ef0e658076d4cef552a7 100644 (file)
@@ -506,147 +506,33 @@ gtk_button_size_allocate (GtkWidget     *widget,
 static void
 gtk_button_paint (GtkWidget    *widget,
                  GdkRectangle *area)
-{
-  GdkRectangle restrict_area;
-  GdkRectangle outer_area;
-  GdkRectangle tmp_area;
-  GdkRectangle new_area;
-  gint xthickness;
-  gint ythickness;
-
-  g_return_if_fail (widget != NULL);
-  g_return_if_fail (GTK_IS_BUTTON (widget));
-
-  xthickness = widget->style->klass->xthickness;
-  ythickness = widget->style->klass->ythickness;
-
-  if (GTK_WIDGET_DRAWABLE (widget))
-    {
-      restrict_area.x = xthickness;
-      restrict_area.y = ythickness;
-      restrict_area.width = GTK_WIDGET (widget)->allocation.width -
-       restrict_area.x * 2 - GTK_CONTAINER (widget)->border_width * 2;
-      restrict_area.height = GTK_WIDGET (widget)->allocation.height -
-       restrict_area.y * 2 - GTK_CONTAINER (widget)->border_width * 2;
-
-      outer_area = restrict_area;
-
-      if (GTK_WIDGET_CAN_DEFAULT (widget))
-       {
-         restrict_area.x += DEFAULT_LEFT_POS;
-         restrict_area.y += DEFAULT_TOP_POS;
-         restrict_area.width -= DEFAULT_SPACING;
-         restrict_area.height -= DEFAULT_SPACING;
-       }
-
-      if (gdk_rectangle_intersect (area, &restrict_area, &new_area))
-       {
-         if ((GTK_WIDGET_STATE (widget) == GTK_STATE_PRELIGHT) &&
-             (GTK_BUTTON (widget)->relief != GTK_RELIEF_NORMAL))
-           gtk_style_set_background (widget->style, widget->window,
-                                     GTK_BUTTON (widget)->relief == GTK_RELIEF_NONE ? GTK_STATE_NORMAL : GTK_WIDGET_STATE (widget));
-         else
-           gtk_style_set_background (widget->style, widget->window, GTK_WIDGET_STATE (widget));
-         gdk_window_clear_area (widget->window,
-                                new_area.x, new_area.y,
-                                new_area.width, new_area.height);
-       }
-
-      if (GTK_WIDGET_CAN_DEFAULT (widget))
-       {
-         /* Now fill spacing area between the default border and the button */
-
- /* 1 */  tmp_area = outer_area;
-                 tmp_area.width = restrict_area.x - outer_area.x;
-                 if (gdk_rectangle_intersect (area, &tmp_area, &new_area))
-                   gdk_draw_rectangle (widget->window,
-                                       widget->style->bg_gc[GTK_STATE_NORMAL],
-                                       TRUE,
-                                       new_area.x, new_area.y,
-                                       new_area.width, new_area.height);
-
-  /* 2 */ tmp_area.x = restrict_area.x + restrict_area.width;
-
-         if (gdk_rectangle_intersect (area, &tmp_area, &new_area))
-           gdk_draw_rectangle (widget->window,
-                               widget->style->bg_gc[GTK_STATE_NORMAL],
-                               TRUE,
-                               new_area.x, new_area.y,
-                               new_area.width, new_area.height);
-
-  /* 3 */ tmp_area.width = restrict_area.width;
-         tmp_area.height = restrict_area.y - outer_area.y;
-         tmp_area.x = restrict_area.x;
-
-         if (gdk_rectangle_intersect (area, &tmp_area, &new_area))
-           gdk_draw_rectangle (widget->window,
-                               widget->style->bg_gc[GTK_STATE_NORMAL],
-                               TRUE,
-                               new_area.x, new_area.y,
-                               new_area.width, new_area.height);
-
-  /* 4 */ tmp_area.y = restrict_area.y + restrict_area.height;
-
-         if (gdk_rectangle_intersect (area, &tmp_area, &new_area))
-           gdk_draw_rectangle (widget->window,
-                               widget->style->bg_gc[GTK_STATE_NORMAL],
-                               TRUE,
-                               new_area.x, new_area.y,
-                               new_area.width, new_area.height);
-       }
-    }
-}
-
-static void
-gtk_button_draw (GtkWidget    *widget,
-                GdkRectangle *area)
-{
-  GtkButton *button;
-  GdkRectangle child_area;
-  GdkRectangle tmp_area;
-
-  g_return_if_fail (widget != NULL);
-  g_return_if_fail (GTK_IS_BUTTON (widget));
-  g_return_if_fail (area != NULL);
-
-  if (GTK_WIDGET_DRAWABLE (widget))
-    {
-      button = GTK_BUTTON (widget);
-
-      tmp_area = *area;
-      tmp_area.x -= GTK_CONTAINER (button)->border_width;
-      tmp_area.y -= GTK_CONTAINER (button)->border_width;
-
-      gtk_button_paint (widget, &tmp_area);
-
-      if (GTK_BIN (button)->child && gtk_widget_intersect (GTK_BIN (button)->child, &tmp_area, &child_area))
-       gtk_widget_draw (GTK_BIN (button)->child, &child_area);
-
-      gtk_widget_draw_default (widget);
-      gtk_widget_draw_focus (widget);
-    }
-}
-
-static void
-gtk_button_draw_focus (GtkWidget *widget)
 {
   GtkButton *button;
   GtkShadowType shadow_type;
   gint width, height;
   gint x, y;
-
-  g_return_if_fail (widget != NULL);
-  g_return_if_fail (GTK_IS_BUTTON (widget));
-
+   
   if (GTK_WIDGET_DRAWABLE (widget))
     {
       button = GTK_BUTTON (widget);
-
+       
       x = 0;
       y = 0;
       width = widget->allocation.width - GTK_CONTAINER (widget)->border_width * 2;
       height = widget->allocation.height - GTK_CONTAINER (widget)->border_width * 2;
 
+      gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
+      gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height);
+
+      if (GTK_WIDGET_HAS_DEFAULT (widget) &&
+         GTK_BUTTON (widget)->relief == GTK_RELIEF_NORMAL)
+       {
+         gtk_paint_box (widget->style, widget->window,
+                        GTK_STATE_NORMAL, GTK_SHADOW_IN,
+                        area, widget, "buttondefault",
+                        x, y, width, height);
+       }
+
       if (GTK_WIDGET_CAN_DEFAULT (widget))
        {
          x += widget->style->klass->xthickness;
@@ -656,7 +542,7 @@ gtk_button_draw_focus (GtkWidget *widget)
          x += DEFAULT_LEFT_POS;
          y += DEFAULT_TOP_POS;
        }
-
+       
       if (GTK_WIDGET_HAS_FOCUS (widget))
        {
          x += 1;
@@ -664,84 +550,73 @@ gtk_button_draw_focus (GtkWidget *widget)
          width -= 2;
          height -= 2;
        }
-      else
-       {
-         if (GTK_WIDGET_STATE (widget) == GTK_STATE_ACTIVE)
-           gdk_draw_rectangle (widget->window,
-                               widget->style->bg_gc[GTK_WIDGET_STATE (widget)], FALSE,
-                               x + 1, y + 1, width - 4, height - 4);
-         else if (button->relief == GTK_RELIEF_NORMAL)
-           gdk_draw_rectangle (widget->window,
-                               widget->style->bg_gc[GTK_WIDGET_STATE (widget)], FALSE,
-                               x + 2, y + 2, width - 5, height - 5);
-         else
-           gdk_draw_rectangle (widget->window,
-                               widget->style->bg_gc[GTK_WIDGET_STATE (widget)], FALSE,
-                               x, y, width - 1, height - 1);
-       }
-
+       
       if (GTK_WIDGET_STATE (widget) == GTK_STATE_ACTIVE)
        shadow_type = GTK_SHADOW_IN;
       else
        shadow_type = GTK_SHADOW_OUT;
 
-      if ((button->relief == GTK_RELIEF_NORMAL) ||
-         ((GTK_WIDGET_STATE (widget) != GTK_STATE_NORMAL) &&
-          (GTK_WIDGET_STATE (widget) != GTK_STATE_INSENSITIVE)))
-       {
-         gtk_draw_shadow (widget->style, widget->window,
-                          button->relief == GTK_RELIEF_NONE ? GTK_STATE_NORMAL : GTK_WIDGET_STATE (widget),
-                          shadow_type,
-                          x, y, width, height);
-       }
-
+      if ((button->relief != GTK_RELIEF_NONE) ||
+         ((GTK_WIDGET_STATE(widget) != GTK_STATE_NORMAL) &&
+          (GTK_WIDGET_STATE(widget) != GTK_STATE_INSENSITIVE)))
+       gtk_paint_box (widget->style, widget->window,
+                      GTK_WIDGET_STATE (widget),
+                      shadow_type, area, widget, "button",
+                      x, y, width, height);
+       
       if (GTK_WIDGET_HAS_FOCUS (widget))
        {
          x -= 1;
          y -= 1;
          width += 2;
          height += 2;
-
-         gdk_draw_rectangle (widget->window,
-                             widget->style->black_gc, FALSE,
-                             x, y, width - 1, height - 1);
+            
+         gtk_paint_focus (widget->style, widget->window,
+                          area, widget, "button",
+                          x, y, width - 1, height - 1);
        }
     }
 }
 
 static void
-gtk_button_draw_default (GtkWidget *widget)
+gtk_button_draw (GtkWidget    *widget,
+                GdkRectangle *area)
 {
-  gint width, height;
-  gint x, y;
+  GtkButton *button;
+  GdkRectangle child_area;
+  GdkRectangle tmp_area;
 
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_BUTTON (widget));
+  g_return_if_fail (area != NULL);
 
   if (GTK_WIDGET_DRAWABLE (widget))
     {
-      x = 0;
-      y = 0;
-      width = widget->allocation.width - GTK_CONTAINER (widget)->border_width * 2;
-      height = widget->allocation.height - GTK_CONTAINER (widget)->border_width * 2;
+      button = GTK_BUTTON (widget);
 
-      if (GTK_WIDGET_HAS_DEFAULT (widget) &&
-         GTK_BUTTON (widget)->relief == GTK_RELIEF_NORMAL)
-       {
-         gtk_draw_shadow (widget->style, widget->window,
-                          GTK_STATE_NORMAL, GTK_SHADOW_IN,
-                          x, y, width, height);
-       }
-      else
-       {
-         gdk_draw_rectangle (widget->window, widget->style->bg_gc[GTK_STATE_NORMAL],
-                             FALSE, x, y, width - 1, height - 1);
-         gdk_draw_rectangle (widget->window, widget->style->bg_gc[GTK_STATE_NORMAL],
-                             FALSE, x + 1, y + 1, width - 3, height - 3);
-       }
+      tmp_area = *area;
+      tmp_area.x -= GTK_CONTAINER (button)->border_width;
+      tmp_area.y -= GTK_CONTAINER (button)->border_width;
+
+      gtk_button_paint (widget, &tmp_area);
+
+      if (GTK_BIN (button)->child && gtk_widget_intersect (GTK_BIN (button)->child, &tmp_area, &child_area))
+       gtk_widget_draw (GTK_BIN (button)->child, &child_area);
     }
 }
 
+static void
+gtk_button_draw_focus (GtkWidget *widget)
+{
+  gtk_widget_draw (widget, NULL);
+}
+
+static void
+gtk_button_draw_default (GtkWidget *widget)
+{
+  gtk_widget_draw (widget, NULL);
+}
+
 static gint
 gtk_button_expose (GtkWidget      *widget,
                   GdkEventExpose *event)
@@ -756,16 +631,13 @@ gtk_button_expose (GtkWidget      *widget,
   if (GTK_WIDGET_DRAWABLE (widget))
     {
       button = GTK_BUTTON (widget);
-
+      
       gtk_button_paint (widget, &event->area);
 
       child_event = *event;
       if (GTK_BIN (button)->child && GTK_WIDGET_NO_WINDOW (GTK_BIN (button)->child) &&
          gtk_widget_intersect (GTK_BIN (button)->child, &event->area, &child_event.area))
        gtk_widget_event (GTK_BIN (button)->child, (GdkEvent*) &child_event);
-
-      gtk_widget_draw_default (widget);
-      gtk_widget_draw_focus (widget);
     }
 
   return FALSE;
index 8b863a8b80f2890d20c8804fd8da516f2e6a2966..3560b422d586eb69f0c1ce254a12d98ec26dd399 100644 (file)
@@ -42,7 +42,6 @@ static void gtk_check_button_draw_indicator      (GtkCheckButton      *check_but
 static void gtk_real_check_button_draw_indicator (GtkCheckButton      *check_button,
                                                  GdkRectangle        *area);
 
-
 static GtkToggleButtonClass *parent_class = NULL;
 
 
@@ -84,7 +83,7 @@ gtk_check_button_class_init (GtkCheckButtonClass *class)
   widget_class->size_request = gtk_check_button_size_request;
   widget_class->size_allocate = gtk_check_button_size_allocate;
   widget_class->expose_event = gtk_check_button_expose;
-
+   
   class->indicator_size = INDICATOR_SIZE;
   class->indicator_spacing = INDICATOR_SPACING;
   class->draw_indicator = gtk_real_check_button_draw_indicator;
@@ -93,6 +92,7 @@ gtk_check_button_class_init (GtkCheckButtonClass *class)
 static void
 gtk_check_button_init (GtkCheckButton *check_button)
 {
+  GTK_WIDGET_SET_FLAGS (check_button, GTK_NO_WINDOW);
   check_button->toggle_button.draw_indicator = TRUE;
 }
 
@@ -137,15 +137,23 @@ gtk_check_button_draw (GtkWidget    *widget,
 
       if (check_button->toggle_button.draw_indicator)
        {
-         button = GTK_BUTTON (widget);
+         gint border_width;
+         button = GTK_BUTTON (widget);
 
          gtk_check_button_draw_indicator (check_button, area);
-
+                 
+         border_width = GTK_CONTAINER (widget)->border_width;
+         if (GTK_WIDGET_HAS_FOCUS (widget))
+           gtk_paint_focus (widget->style, widget->window,
+                            NULL, widget, "checkbutton",
+                            border_width + widget->allocation.x,
+                            border_width + widget->allocation.y,
+                            widget->allocation.width - 2 * border_width - 1,
+                            widget->allocation.height - 2 * border_width - 1);
+         
          if (GTK_BIN (button)->child && GTK_WIDGET_NO_WINDOW (GTK_BIN (button)->child) &&
              gtk_widget_intersect (GTK_BIN (button)->child, area, &child_area))
            gtk_widget_draw (GTK_BIN (button)->child, &child_area);
-
-         gtk_widget_draw_focus (widget);
        }
       else
        {
@@ -158,38 +166,17 @@ gtk_check_button_draw (GtkWidget    *widget,
 static void
 gtk_check_button_draw_focus (GtkWidget *widget)
 {
-  GtkCheckButton *check_button;
+  gint border_width;
   
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_CHECK_BUTTON (widget));
-  
-  if (GTK_WIDGET_DRAWABLE (widget))
-    {
-      check_button = GTK_CHECK_BUTTON (widget);
-      if (check_button->toggle_button.draw_indicator)
-       {
-         gint border_width;
-         
-         border_width = GTK_CONTAINER (widget)->border_width;
-         if (GTK_WIDGET_HAS_FOCUS (widget))
-           gdk_draw_rectangle (widget->window,
-                               widget->style->black_gc, FALSE,
-                               border_width, border_width,
-                               widget->allocation.width - 2 * border_width - 1,
-                               widget->allocation.height - 2 * border_width - 1);
-         else
-           gdk_draw_rectangle (widget->window,
-                               widget->style->bg_gc[GTK_STATE_NORMAL], FALSE,
-                               border_width, border_width,
-                               widget->allocation.width - 2 * border_width - 1,
-                               widget->allocation.height - 2 * border_width - 1);
-       }
-      else
-       {
-         if (GTK_WIDGET_CLASS (parent_class)->draw_focus)
-           (* GTK_WIDGET_CLASS (parent_class)->draw_focus) (widget);
-       }
-    }
+
+  border_width = GTK_CONTAINER (widget)->border_width;
+  gtk_widget_queue_clear_area(widget->parent, 
+                             border_width + widget->allocation.x,
+                             border_width + widget->allocation.y,
+                             widget->allocation.width - 2 * border_width,
+                             widget->allocation.height - 2 * border_width);
 }
 
 static void
@@ -227,19 +214,21 @@ gtk_check_button_size_allocate (GtkWidget     *widget,
                                GtkAllocation *allocation)
 {
   GtkCheckButton *check_button;
+  GtkToggleButton *toggle_button;
   GtkButton *button;
   GtkAllocation child_allocation;
-
+  
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_CHECK_BUTTON (widget));
   g_return_if_fail (allocation != NULL);
 
   check_button = GTK_CHECK_BUTTON (widget);
+  toggle_button = GTK_TOGGLE_BUTTON (widget);
   if (check_button->toggle_button.draw_indicator)
     {
       widget->allocation = *allocation;
       if (GTK_WIDGET_REALIZED (widget))
-       gdk_window_move_resize (widget->window,
+       gdk_window_move_resize (toggle_button->event_window,
                                allocation->x, allocation->y,
                                allocation->width, allocation->height);
 
@@ -249,11 +238,16 @@ gtk_check_button_size_allocate (GtkWidget     *widget,
        {
          child_allocation.x = (GTK_CONTAINER (widget)->border_width +
                                CHECK_BUTTON_CLASS (widget)->indicator_size +
-                               CHECK_BUTTON_CLASS (widget)->indicator_spacing * 3 + 1);
-         child_allocation.y = GTK_CONTAINER (widget)->border_width + 1;
-         child_allocation.width = MAX (1, allocation->width - child_allocation.x  -
+                               CHECK_BUTTON_CLASS (widget)->indicator_spacing * 3 + 1 +
+                               widget->allocation.x);
+          child_allocation.y = GTK_CONTAINER (widget)->border_width + 1 +
+            widget->allocation.y;
+         child_allocation.width = MAX (1, allocation->width - 
+                                       (GTK_CONTAINER (widget)->border_width +
+                                        CHECK_BUTTON_CLASS (widget)->indicator_size +
+                                        CHECK_BUTTON_CLASS (widget)->indicator_spacing * 3 + 1)  -
                                    GTK_CONTAINER (widget)->border_width - 1);
-         child_allocation.height = MAX (1, allocation->height - child_allocation.y * 2);
+         child_allocation.height = MAX (1, allocation->height - (GTK_CONTAINER (widget)->border_width + 1) * 2);
 
          gtk_widget_size_allocate (GTK_BIN (button)->child, &child_allocation);
        }
@@ -333,34 +327,43 @@ gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
   GdkRectangle new_area;
   gint width, height;
   gint x, y;
-
+   GdkWindow *window;
+   
   g_return_if_fail (check_button != NULL);
   g_return_if_fail (GTK_IS_CHECK_BUTTON (check_button));
 
+   
   if (GTK_WIDGET_DRAWABLE (check_button))
     {
       widget = GTK_WIDGET (check_button);
       toggle_button = GTK_TOGGLE_BUTTON (check_button);
 
-      state_type = GTK_WIDGET_STATE (widget);
+       window = widget->window;
+       if (!window)
+        return;
+
+       state_type = GTK_WIDGET_STATE (widget);
       if ((state_type != GTK_STATE_NORMAL) &&
          (state_type != GTK_STATE_PRELIGHT))
        state_type = GTK_STATE_NORMAL;
 
-      restrict_area.x = GTK_CONTAINER (widget)->border_width;
-      restrict_area.y = restrict_area.x;
-      restrict_area.width = widget->allocation.width - restrict_area.x * 2;
-      restrict_area.height = widget->allocation.height - restrict_area.x * 2;
+      restrict_area.x = widget->allocation.x + GTK_CONTAINER (widget)->border_width;
+      restrict_area.y = widget->allocation.y + GTK_CONTAINER (widget)->border_width;
+      restrict_area.width = widget->allocation.width - ( 2 * GTK_CONTAINER (widget)->border_width);
+      restrict_area.height = widget->allocation.height - ( 2 * GTK_CONTAINER (widget)->border_width);
 
       if (gdk_rectangle_intersect (area, &restrict_area, &new_area))
        {
-         gtk_style_set_background (widget->style, widget->window, state_type);
-         gdk_window_clear_area (widget->window, new_area.x, new_area.y,
-                                new_area.width, new_area.height);
+          if (state_type != GTK_STATE_NORMAL)
+            gtk_paint_flat_box(widget->style, window, state_type, 
+                               GTK_SHADOW_ETCHED_OUT, 
+                               area, widget, "checkbutton",
+                               new_area.x, new_area.y,
+                               new_area.width, new_area.height);
        }
       
-      x = CHECK_BUTTON_CLASS (widget)->indicator_spacing + GTK_CONTAINER (widget)->border_width;
-      y = (widget->allocation.height - CHECK_BUTTON_CLASS (widget)->indicator_size) / 2;
+      x = widget->allocation.x + CHECK_BUTTON_CLASS (widget)->indicator_spacing + GTK_CONTAINER (widget)->border_width;
+      y = widget->allocation.y + (widget->allocation.height - CHECK_BUTTON_CLASS (widget)->indicator_size) / 2;
       width = CHECK_BUTTON_CLASS (widget)->indicator_size;
       height = CHECK_BUTTON_CLASS (widget)->indicator_size;
 
@@ -369,11 +372,10 @@ gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
       else
        shadow_type = GTK_SHADOW_OUT;
 
-      gdk_draw_rectangle (widget->window,
-                         widget->style->bg_gc[GTK_WIDGET_STATE (widget)],
-                         TRUE, x + 1, y + 1, width, height);
-      gtk_draw_shadow (widget->style, widget->window,
-                      GTK_WIDGET_STATE (widget), shadow_type,
-                      x + 1, y + 1, width, height);
+       gtk_paint_check (widget->style, window,
+                       GTK_WIDGET_STATE (widget), shadow_type,
+                       area, widget, "checkbutton",
+                       x + 1, y + 1, width, height);
     }
 }
+
index c21050c269b90dcce5a712585636b66b2b5d9d2b..6db3c8040f1fef1ec69f5854fcf2cf58b47ae918 100644 (file)
@@ -244,8 +244,6 @@ gtk_real_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
           widget->style->klass->xthickness + 2);
       y = (widget->allocation.height - height) / 2;
 
-      gdk_window_clear_area (widget->window, x, y, width, height);
-
       if (check_menu_item->active ||
          check_menu_item->always_show_toggle ||
          (GTK_WIDGET_STATE (check_menu_item) == GTK_STATE_PRELIGHT))
@@ -266,11 +264,9 @@ gtk_real_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
                shadow_type = GTK_SHADOW_OUT;
            }
          
-         gdk_draw_rectangle (widget->window,
-                             widget->style->bg_gc[state_type],
-                             TRUE, x, y, width, height);
-         gtk_draw_shadow (widget->style, widget->window,
+         gtk_paint_check (widget->style, widget->window,
                           state_type, shadow_type,
+                          area, widget, "check",
                           x, y, width, height);
        }
     }
index c8822743a9bfcf6efc22d1977a4e167c11ccec5a..89b253267ccb9b31b04cf36e9603ca45caaf8b27 100644 (file)
@@ -21,6 +21,7 @@
 #include <math.h>
 #include <gdk/gdk.h>
 #include "gtkcolorsel.h"
+#include "gtkdrawwindow.h"
 #include "gtkhbbox.h"
 #include "gtkdnd.h"
 #include "gtkselection.h"
@@ -861,7 +862,7 @@ gtk_color_selection_drag_begin (GtkWidget      *widget,
   gdouble colors[4];
   GdkColor bg;
 
-  window = gtk_window_new(GTK_WINDOW_POPUP);
+  window = gtk_draw_window_new(GTK_WINDOW_POPUP);
   gtk_widget_set_usize (window, 48, 32);
   gtk_widget_realize (window);
 
@@ -1041,14 +1042,15 @@ gtk_color_selection_value_events (GtkWidget *area,
 
   colorsel = (GtkColorSelection*) gtk_object_get_data (GTK_OBJECT (area), "_GtkColorSelection");
 
+  if (colorsel->value_gc == NULL)
+    colorsel->value_gc = gdk_gc_new (colorsel->value_area->window);
+
   switch (event->type)
     {
     case GDK_MAP:
       gtk_color_selection_draw_value_marker (colorsel);
       break;
     case GDK_EXPOSE:
-      if (colorsel->value_gc == NULL)
-       colorsel->value_gc = gdk_gc_new (colorsel->value_area->window);
       gtk_color_selection_draw_value_marker (colorsel);
       break;
     case GDK_BUTTON_PRESS:
@@ -1128,7 +1130,14 @@ gtk_color_selection_wheel_events (GtkWidget *area,
   gint x, y;
 
   colorsel = (GtkColorSelection*) gtk_object_get_data (GTK_OBJECT (area), "_GtkColorSelection");
-
+  
+  if (colorsel->wheel_gc == NULL)
+    colorsel->wheel_gc = gdk_gc_new (colorsel->wheel_area->window);
+  if (colorsel->sample_gc == NULL)
+    colorsel->sample_gc = gdk_gc_new (colorsel->sample_area->window);
+  if (colorsel->value_gc == NULL)
+    colorsel->value_gc = gdk_gc_new (colorsel->value_area->window);
+  
   switch (event->type)
     {
     case GDK_MAP:
@@ -1137,12 +1146,6 @@ gtk_color_selection_wheel_events (GtkWidget *area,
       gtk_color_selection_draw_sample (colorsel, TRUE);
       break;
     case GDK_EXPOSE:
-      if (colorsel->wheel_gc == NULL)
-       colorsel->wheel_gc = gdk_gc_new (colorsel->wheel_area->window);
-      if (colorsel->sample_gc == NULL)
-       colorsel->sample_gc = gdk_gc_new (colorsel->sample_area->window);
-      if (colorsel->value_gc == NULL)
-       colorsel->value_gc = gdk_gc_new (colorsel->value_area->window);
       gtk_color_selection_draw_wheel_marker (colorsel);
       gtk_color_selection_draw_wheel_frame (colorsel);
       break;
@@ -1247,7 +1250,7 @@ gtk_color_selection_draw_value_bar (GtkColorSelection *colorsel,
       v -= sv;
     }
 
-  gtk_widget_draw (colorsel->value_area, NULL);
+  gtk_widget_queue_draw (colorsel->value_area);
 }
 
 static void
@@ -1320,7 +1323,39 @@ gtk_color_selection_draw_wheel (GtkColorSelection *colorsel,
       gtk_preview_draw_row (GTK_PREVIEW (colorsel->wheel_area), colorsel->wheel_buf, 0, y, wid);
     }
 
-  gtk_widget_draw (colorsel->wheel_area, NULL);
+  if (colorsel->wheel_area->window)
+     {
+       GdkPixmap *pm = NULL;
+       GdkGC     *pmgc = NULL;
+       GdkColor   col;
+       gint w, h;
+       
+       pm = gdk_pixmap_new (colorsel->wheel_area->window, wid, heig, 1);
+       pmgc = gdk_gc_new (pm);
+       
+       col.pixel = 0;
+       gdk_gc_set_foreground(pmgc, &col);
+       gdk_draw_rectangle(pm, pmgc, TRUE, 0, 0, wid, heig);
+       col.pixel = 1;
+       
+       gdk_gc_set_foreground(pmgc, &col);
+       gdk_draw_arc (pm, pmgc, TRUE, 0, 0, wid, heig, 0, 360*64);
+
+       w = colorsel->wheel_area->allocation.width;
+       h = colorsel->wheel_area->allocation.height;
+       
+       gdk_draw_arc (pm, pmgc,
+                     FALSE, 1, 1, w - 1, h - 1, 30 * 64, 180 * 64);
+       gdk_draw_arc (pm, pmgc,
+                     FALSE, 0, 0, w, h, 30 * 64, 180 * 64);
+       gdk_draw_arc (pm, pmgc,
+                     FALSE, 1, 1, w - 1, h - 1, 210 * 64, 180 * 64);
+       gdk_draw_arc (pm, pmgc,
+                     FALSE, 0, 0, w, h, 210 * 64, 180 * 64);
+       gdk_window_shape_combine_mask(colorsel->wheel_area->window, pm, 0, 0);
+       gdk_pixmap_unref(pm);
+       gdk_gc_destroy(pmgc);
+     }
 }
 
 static void
@@ -1385,7 +1420,7 @@ gtk_color_selection_draw_sample (GtkColorSelection *colorsel,
       gtk_preview_draw_row (GTK_PREVIEW (colorsel->sample_area), colorsel->sample_buf, 0, y, wid);
     }
 
-  gtk_widget_draw (colorsel->sample_area, NULL);
+  gtk_widget_queue_draw (colorsel->sample_area);
 }
 
 static gint
index 80e770115fa19511ddadcf5059beeb7c226a5def..e430da3b74090eb6937a9efc02ee1c2a1e79ef32 100644 (file)
@@ -50,6 +50,9 @@ struct _GtkChildArgInfo
   guint seq_id;
 };
 
+/* The global list of toplevel windows */
+static GList *toplevel_list = NULL;
+
 static void gtk_container_base_class_init   (GtkContainerClass *klass);
 static void gtk_container_class_init        (GtkContainerClass *klass);
 static void gtk_container_init              (GtkContainer      *container);
@@ -1235,6 +1238,10 @@ gtk_container_children (GtkContainer *container)
 void
 gtk_container_register_toplevel (GtkContainer *container)
 {
+  g_return_if_fail (container != NULL);
+  
+  toplevel_list = g_list_prepend (toplevel_list, container);
+  
   gtk_widget_ref (GTK_WIDGET (container));
   gtk_object_sink (GTK_OBJECT (container));
 }
@@ -1242,9 +1249,28 @@ gtk_container_register_toplevel (GtkContainer *container)
 void
 gtk_container_unregister_toplevel (GtkContainer *container)
 {
+  GList *node;
+
+  g_return_if_fail (container != NULL);
+
+  node = g_list_find (toplevel_list, container);
+  g_return_if_fail (node != NULL);
+
+  toplevel_list = g_list_remove_link (toplevel_list, node);
+  g_list_free_1 (node);
+
   gtk_widget_unref (GTK_WIDGET (container));
 }
 
+GList *
+gtk_container_get_toplevels (void)
+{
+  /* XXX: fixme we should ref all these widgets and duplicate
+   * the list.
+   */
+  return toplevel_list;
+}
+
 void
 gtk_container_real_set_focus_child (GtkContainer     *container,
                                    GtkWidget        *child)
index 3e80b4a832e185ed3dd45589284dde14b2b19eee..d14955c07bf1909fddf33dc21e191b24dd9c62ec 100644 (file)
@@ -130,6 +130,8 @@ void   gtk_container_set_focus_hadjustment (GtkContainer     *container,
                                            GtkAdjustment    *adjustment);
 void    gtk_container_register_toplevel           (GtkContainer     *container);
 void    gtk_container_unregister_toplevel  (GtkContainer     *container);
+GList * gtk_container_get_toplevels        (void);
+
 void    gtk_container_resize_children      (GtkContainer     *container);
 
 GtkType gtk_container_child_type          (GtkContainer     *container);
index b867e6b7a1203066bd690e451e0cb9e507125573..36442e1303e1f13adbb9f4b29311da5cf8354197 100644 (file)
@@ -239,9 +239,9 @@ gtk_curve_draw (GtkCurve *c, gint width, gint height)
   style = GTK_WIDGET (c)->style;
 
   /* clear the pixmap: */
-  gdk_draw_rectangle (c->pixmap, style->bg_gc[state], TRUE,
+  gtk_paint_flat_box (style, c->pixmap, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
+                     NULL, GTK_WIDGET(c), "curve_bg",
                      0, 0, width + RADIUS * 2, height + RADIUS * 2);
-
   /* draw the grid lines: (XXX make more meaningful) */
   for (i = 0; i < 5; i++)
     {
index 20063c99b7c207d4d49985d1c640ce902ef98893..151a5c0eb8aba083eef35f1f06ce82ff21ccc9bf 100644 (file)
@@ -23,7 +23,7 @@
 #include "gtkinvisible.h"
 #include "gtkmain.h"
 #include "gtksignal.h"
-#include "gtkwindow.h"
+#include "gtkdrawwindow.h"
 
 static GSList *drag_widgets = NULL;
 
@@ -83,6 +83,7 @@ struct _GtkDragDestSite {
   GdkDragAction      actions;
   GdkWindow         *proxy_window;
   GdkDragProtocol    proxy_protocol;
+  gboolean           do_proxy : 1;
   gboolean           proxy_coords : 1;
   gboolean           have_drag : 1;
 };
@@ -128,7 +129,7 @@ struct _GtkDragFindData {
 /* Enumeration for some targets we handle internally */
 
 enum {
-  TARGET_MOTIF_SUCCESS = 0x80000000,
+  TARGET_MOTIF_SUCCESS = 0x40000000,
   TARGET_MOTIF_FAILURE,
   TARGET_DELETE
 };
@@ -694,7 +695,7 @@ gtk_drag_dest_set   (GtkWidget       *widget,
     site->target_list = NULL;
 
   site->actions = actions;
-  site->proxy_window = NULL;
+  site->do_proxy = FALSE;
 
   gtk_object_set_data_full (GTK_OBJECT (widget), "gtk-drag-dest",
                            site, gtk_drag_dest_site_destroy);
@@ -741,7 +742,9 @@ gtk_drag_dest_set_proxy (GtkWidget      *widget,
   site->target_list = NULL;
   site->actions = 0;
   site->proxy_window = proxy_window;
-  gdk_window_ref (proxy_window);
+  if (proxy_window)
+    gdk_window_ref (proxy_window);
+  site->do_proxy = TRUE;
   site->proxy_protocol = protocol;
   site->proxy_coords = use_coordinates;
 
@@ -1172,7 +1175,7 @@ gtk_drag_dest_leave (GtkWidget      *widget,
   site = gtk_object_get_data (GTK_OBJECT (widget), "gtk-drag-dest");
   g_return_if_fail (site != NULL);
 
-  if (site->proxy_window)
+  if (site->do_proxy)
     {
       GtkDragDestInfo *info = g_dataset_get_data (context, "gtk-info");
 
@@ -1183,14 +1186,14 @@ gtk_drag_dest_leave (GtkWidget      *widget,
     }
   else
     {
+      if (site->flags & GTK_DEST_DEFAULT_HIGHLIGHT)
+       gtk_drag_unhighlight (widget);
+
       if (!(site->flags & GTK_DEST_DEFAULT_MOTION) || site->have_drag)
        gtk_signal_emit_by_name (GTK_OBJECT (widget), "drag_leave",
                                 context, time);
       
       site->have_drag = FALSE;
-      
-      if (site->flags & GTK_DEST_DEFAULT_HIGHLIGHT)
-       gtk_drag_unhighlight (widget);
     }
 }
 
@@ -1208,10 +1211,13 @@ gtk_drag_dest_motion (GtkWidget      *widget,
   site = gtk_object_get_data (GTK_OBJECT (widget), "gtk-drag-dest");
   g_return_val_if_fail (site != NULL, FALSE);
 
-  if (site->proxy_window)
+  if (site->do_proxy)
     {
       GdkAtom selection;
       GdkEvent *current_event;
+      GdkWindow *dest_window;
+      GdkDragProtocol proto;
+       
       GtkDragDestInfo *info = g_dataset_get_data (context, "gtk-info");
 
       if (!info->proxy_source)
@@ -1219,9 +1225,22 @@ gtk_drag_dest_motion (GtkWidget       *widget,
 
       current_event = gtk_get_current_event ();
 
+      if (site->proxy_window)
+       {
+         dest_window = site->proxy_window;
+         proto = site->proxy_protocol;
+       }
+      else
+       {
+         gdk_drag_find_window (info->proxy_source->context,
+                               NULL,
+                               current_event->dnd.x_root, 
+                               current_event->dnd.y_root,
+                               &dest_window, &proto);
+       }
+      
       gdk_drag_motion (info->proxy_source->context, 
-                      site->proxy_window,
-                      site->proxy_protocol,
+                      dest_window, proto,
                       current_event->dnd.x_root, 
                       current_event->dnd.y_root, 
                       context->suggested_action, time);
@@ -1298,7 +1317,7 @@ gtk_drag_dest_drop (GtkWidget          *widget,
   info->drop_x = x;
   info->drop_y = y;
 
-  if (site->proxy_window)
+  if (site->do_proxy)
     {
       if (info->proxy_source || 
          (info->context->protocol == GDK_DRAG_PROTO_ROOTWIN))
@@ -1313,6 +1332,8 @@ gtk_drag_dest_drop (GtkWidget          *widget,
          
          GdkEvent *current_event;
          GdkAtom selection;
+         GdkWindow *dest_window;
+         GdkDragProtocol proto;
          
          gtk_drag_proxy_begin (widget, info);
          info->proxy_drop_wait = TRUE;
@@ -1320,9 +1341,22 @@ gtk_drag_dest_drop (GtkWidget         *widget,
          
          current_event = gtk_get_current_event ();
 
+         if (site->proxy_window)
+           {
+             dest_window = site->proxy_window;
+             proto = site->proxy_protocol;
+           }
+         else
+           {
+             gdk_drag_find_window (info->proxy_source->context,
+                                   NULL,
+                                   current_event->dnd.x_root, 
+                                   current_event->dnd.y_root,
+                                   &dest_window, &proto);
+           }
+           
          gdk_drag_motion (info->proxy_source->context, 
-                          site->proxy_window,
-                          site->proxy_protocol,
+                          dest_window, proto,
                           current_event->dnd.x_root, 
                           current_event->dnd.y_root, 
                           context->suggested_action, time);
@@ -1430,7 +1464,7 @@ gtk_drag_begin (GtkWidget         *widget,
            gtk_drag_get_event_action (event, info->button, actions));
 
   gtk_signal_emit_by_name (GTK_OBJECT (widget), "drag_begin",
-                          info->context, NULL);
+                          info->context);
   
   /* We use a GTK grab here to override any grabs that the widget
    * we are dragging from might have held
@@ -1499,7 +1533,8 @@ gtk_drag_source_set  (GtkWidget         *widget,
 
   gtk_widget_add_events (widget,
                         gtk_widget_get_events (widget) |
-                        GDK_BUTTON_PRESS_MASK | GDK_BUTTON_MOTION_MASK);
+                        GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
+                        GDK_BUTTON_MOTION_MASK);
 
   if (site)
     {
@@ -1647,7 +1682,7 @@ gtk_drag_set_icon_pixmap  (GdkDragContext    *context,
   gtk_widget_push_visual (gdk_colormap_get_visual(colormap));
   gtk_widget_push_colormap (colormap);
 
-  window = gtk_window_new (GTK_WINDOW_POPUP);
+  window = gtk_draw_window_new (GTK_WINDOW_POPUP);
 
   gtk_widget_pop_visual ();
   gtk_widget_pop_colormap ();
@@ -2007,12 +2042,21 @@ gtk_drag_source_event_cb (GtkWidget      *widget,
     case GDK_BUTTON_PRESS:
       if ((GDK_BUTTON1_MASK << (event->button.button - 1)) & site->start_button_mask)
        {
+         site->state |= (GDK_BUTTON1_MASK << (event->button.button - 1));
          site->x = event->button.x;
          site->y = event->button.y;
        }
+      break;
+      
+    case GDK_BUTTON_RELEASE:
+      if ((GDK_BUTTON1_MASK << (event->button.button - 1)) & site->start_button_mask)
+       {
+         site->state &= ~(GDK_BUTTON1_MASK << (event->button.button - 1));
+       }
+      break;
       
     case GDK_MOTION_NOTIFY:
-      if (event->motion.state & site->start_button_mask)
+      if (site->state & event->motion.state & site->start_button_mask)
        {
          /* FIXME: This is really broken and can leave us
           * with a stuck grab
@@ -2020,7 +2064,8 @@ gtk_drag_source_event_cb (GtkWidget      *widget,
          int i;
          for (i=1; i<6; i++)
            {
-             if (event->motion.state & GDK_BUTTON1_MASK << (i - 1))
+             if (site->state & event->motion.state & 
+                 GDK_BUTTON1_MASK << (i - 1))
                break;
            }
          
@@ -2030,6 +2075,7 @@ gtk_drag_source_event_cb (GtkWidget      *widget,
              GtkDragSourceInfo *info;
              GdkDragContext *context;
              
+             site->state = 0;
              context = gtk_drag_begin (widget, site->target_list,
                                        site->actions, 
                                        i, event);
@@ -2054,6 +2100,7 @@ gtk_drag_source_event_cb (GtkWidget      *widget,
       break;
       
     default:                   /* hit for 2/3BUTTON_PRESS */
+      break;
     }
   return FALSE;
 }
@@ -2183,6 +2230,10 @@ gtk_drag_source_info_destroy (gpointer data)
 
   gtk_drag_remove_icon (data);
 
+  if (!info->proxy_dest)
+    gtk_signal_emit_by_name (GTK_OBJECT (info->widget), "drag_end", 
+                            info->context);
+
   if (info->widget)
     gtk_widget_unref (info->widget);
   
index 399a0390de488bb30ee6205e1d073809f8daff36..98ca190a359364b8cccdfb61c65d5c7f886ec2ef 100644 (file)
@@ -26,7 +26,6 @@
 
 #ifdef __cplusplus
 extern "C" {
-#pragma }
 #endif /* __cplusplus */
 
 typedef enum {
diff --git a/gtk/gtkdrawwindow.c b/gtk/gtkdrawwindow.c
new file mode 100644 (file)
index 0000000..b8df2a4
--- /dev/null
@@ -0,0 +1,125 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#include "gtkdrawwindow.h"
+
+static void gtk_draw_window_class_init (GtkDrawWindowClass *klass);
+static void gtk_draw_window_init       (GtkDrawWindow      *draw_window);
+static void gtk_draw_window_draw       (GtkWidget          *widget,
+                                       GdkRectangle       *area);
+static gint gtk_draw_window_expose     (GtkWidget          *widget,
+                                       GdkEventExpose     *event);
+
+
+GtkType
+gtk_draw_window_get_type (void)
+{
+  static GtkType draw_window_type = 0;
+
+  if (!draw_window_type)
+    {
+      GtkTypeInfo draw_window_info =
+      {
+       "GtkDrawWindow",
+       sizeof (GtkDrawWindow),
+       sizeof (GtkDrawWindowClass),
+       (GtkClassInitFunc) gtk_draw_window_class_init,
+       (GtkObjectInitFunc) gtk_draw_window_init,
+       /* reserved_1 */ NULL,
+        /* reserved_2 */ NULL,
+        (GtkClassInitFunc) NULL,
+      };
+
+      draw_window_type = gtk_type_unique (GTK_TYPE_WINDOW, &draw_window_info);
+    }
+
+  return draw_window_type;
+}
+
+static void
+gtk_draw_window_class_init (GtkDrawWindowClass *class)
+{
+  GtkWidgetClass *widget_class;
+
+  widget_class = (GtkWidgetClass*) class;
+
+  widget_class->draw = gtk_draw_window_draw;
+  widget_class->expose_event = gtk_draw_window_expose;
+}
+
+static void
+gtk_draw_window_init (GtkDrawWindow *draw_window)
+{
+}
+
+static gint
+gtk_draw_window_expose (GtkWidget      *widget,
+                       GdkEventExpose *event)
+{
+  GtkBin *bin;
+  GdkEventExpose child_event;
+
+  g_return_val_if_fail (widget != NULL, FALSE);
+  g_return_val_if_fail (GTK_IS_BIN (widget), FALSE);
+  g_return_val_if_fail (event != NULL, FALSE);
+
+  if (GTK_WIDGET_DRAWABLE (widget))
+    {
+      bin = GTK_BIN (widget);
+
+      child_event = *event;
+      if (bin->child &&
+         GTK_WIDGET_NO_WINDOW (bin->child) &&
+         gtk_widget_intersect (bin->child, &event->area, &child_event.area))
+       gtk_widget_event (bin->child, (GdkEvent*) &child_event);
+    }
+
+  return FALSE;
+}
+
+static void
+gtk_draw_window_draw (GtkWidget    *widget,
+                     GdkRectangle *area)
+{
+  GtkBin *bin;
+  GdkRectangle child_area;
+
+  g_return_if_fail (widget != NULL);
+  g_return_if_fail (GTK_IS_BIN (widget));
+
+  if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget))
+    {
+      bin = GTK_BIN (widget);
+
+      if (bin->child &&
+         gtk_widget_intersect (bin->child, area, &child_area))
+        gtk_widget_draw (bin->child, &child_area);
+    }
+}
+
+GtkWidget*
+gtk_draw_window_new (GtkWindowType type)
+{
+  GtkWindow *window;
+
+  window = gtk_type_new (GTK_TYPE_DRAW_WINDOW);
+
+  window->type = type;
+
+  return GTK_WIDGET (window);
+}
diff --git a/gtk/gtkdrawwindow.h b/gtk/gtkdrawwindow.h
new file mode 100644 (file)
index 0000000..20f9f7f
--- /dev/null
@@ -0,0 +1,63 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#ifndef __GTK_DRAW_WINDOW_H__
+#define __GTK_DRAW_WINDOW_H__
+
+
+#include <gdk/gdk.h>
+#include <gtk/gtkwindow.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+#define GTK_TYPE_DRAW_WINDOW                  (gtk_draw_window_get_type ())
+#define GTK_DRAW_WINDOW(obj)                  (GTK_CHECK_CAST ((obj), GTK_TYPE_DRAW_WINDOW, GtkDrawWindow))
+#define GTK_DRAW_WINDOW_CLASS(klass)          (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_DRAW_WINDOW, GtkDrawWindowClass))
+#define GTK_IS_DRAW_WINDOW(obj)               (GTK_CHECK_TYPE ((obj), GTK_TYPE_DRAW_WINDOW))
+#define GTK_IS_DRAW_WINDOW_CLASS(klass)       (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DRAW_WINDOW))
+
+
+typedef struct _GtkDrawWindow        GtkDrawWindow;
+typedef struct _GtkDrawWindowClass   GtkDrawWindowClass;
+typedef struct _GtkDrawWindowButton  GtkDrawWindowButton;
+
+
+struct _GtkDrawWindow
+{
+  GtkWindow window;
+};
+
+struct _GtkDrawWindowClass
+{
+  GtkWindowClass parent_class;
+};
+
+
+GtkType    gtk_draw_window_get_type (void);
+GtkWidget* gtk_draw_window_new      (GtkWindowType        type);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+
+#endif /* __GTK_DRAW_WINDOW_H__ */
index 1e9922486aa62c990de9621ebbd67245e269375f..663485be557948e686ef49266551d367996ad9d5 100644 (file)
@@ -27,6 +27,7 @@
 #include "gtkmain.h"
 #include "gtkselection.h"
 #include "gtksignal.h"
+#include "gtkstyle.h"
 #include "gtkprivate.h"
 
 #define MIN_ENTRY_WIDTH  150
@@ -564,8 +565,8 @@ gtk_entry_realize (GtkWidget *widget)
   widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
   gdk_window_set_user_data (widget->window, entry);
 
-  attributes.x = widget->style->klass->xthickness + INNER_BORDER;
-  attributes.y = widget->style->klass->ythickness + INNER_BORDER;
+  attributes.x = widget->style->klass->xthickness;
+  attributes.y = widget->style->klass->ythickness;
   attributes.width = widget->allocation.width - attributes.x * 2;
   attributes.height = widget->requisition.height - attributes.y * 2;
   attributes.cursor = entry->cursor = gdk_cursor_new (GDK_XTERM);
@@ -700,22 +701,18 @@ gtk_entry_draw_focus (GtkWidget *widget)
          width -= 2;
          height -= 2;
        }
-      else
-       {
-         gdk_draw_rectangle (widget->window, 
-                             widget->style->base_gc[GTK_WIDGET_STATE (widget)],
-                             FALSE, x + 2, y + 2, width - 5, height - 5);
-       }
 
-      gtk_draw_shadow (widget->style, widget->window,
-                      GTK_STATE_NORMAL, GTK_SHADOW_IN,
-                      x, y, width, height);
+      gtk_paint_shadow (widget->style, widget->window,
+                       GTK_STATE_NORMAL, GTK_SHADOW_IN,
+                       NULL, widget, "entry",
+                       x, y, width, height);
 
       if (GTK_WIDGET_HAS_FOCUS (widget))
        {
-         gdk_window_get_size (widget->window, &width, &height);
-         gdk_draw_rectangle (widget->window, widget->style->fg_gc[GTK_STATE_NORMAL],
-                             FALSE, 0, 0, width - 1, height - 1);
+          gdk_window_get_size (widget->window, &width, &height);
+          gtk_paint_focus (widget->style, widget->window, 
+                           NULL, widget, "entry",
+                           0, 0, width - 1, height - 1);
        }
 
       if (GTK_EDITABLE (widget)->editable)
@@ -759,10 +756,10 @@ gtk_entry_size_allocate (GtkWidget     *widget,
                              allocation->y + (allocation->height - widget->requisition.height) / 2,
                              allocation->width, widget->requisition.height);
       gdk_window_move_resize (entry->text_area,
-                             widget->style->klass->xthickness + INNER_BORDER,
-                             widget->style->klass->ythickness + INNER_BORDER,
-                             allocation->width - (widget->style->klass->xthickness + INNER_BORDER) * 2,
-                             widget->requisition.height - (widget->style->klass->ythickness + INNER_BORDER) * 2);
+                             widget->style->klass->xthickness,
+                             widget->style->klass->ythickness,
+                             allocation->width - widget->style->klass->xthickness * 2,
+                             widget->requisition.height - widget->style->klass->ythickness * 2);
 
       /* And make sure the cursor is on screen */
       gtk_entry_adjust_scroll (entry);
@@ -1273,7 +1270,11 @@ gtk_entry_draw_text (GtkEntry *entry)
 
       if (!entry->text)
        {         
-         gdk_window_clear (entry->text_area);
+         gtk_paint_flat_box (widget->style, entry->text_area,
+                             GTK_WIDGET_STATE(widget), GTK_SHADOW_NONE,
+                             NULL, widget, "entry_bg", 
+                             0, 0, -1, -1);
+
          if (editable->editable)
            gtk_entry_draw_cursor (entry);
          return;
@@ -1289,21 +1290,18 @@ gtk_entry_draw_text (GtkEntry *entry)
       use_backing_pixmap = GTK_WIDGET_HAS_FOCUS (widget) && (entry->text != NULL);
       if (use_backing_pixmap)
        {
-         gtk_entry_make_backing_pixmap (entry, width, height);
-         drawable = entry->backing_pixmap;
-         gdk_draw_rectangle (drawable,
-                             widget->style->base_gc[GTK_WIDGET_STATE(widget)],
-                             TRUE,
-                             0, 0,
-                             width,
-                             height);
+          gtk_entry_make_backing_pixmap (entry, width, height);
+          drawable = entry->backing_pixmap;
        }
-      else
-       {
-         drawable = entry->text_area;
-         gdk_window_clear (entry->text_area);
-       }
+       else
+        {
+           drawable = entry->text_area;
+        }
+       gtk_paint_flat_box (widget->style, drawable, 
+                          GTK_WIDGET_STATE(widget), GTK_SHADOW_NONE,
+                          NULL, widget, "entry_bg", 
+                          0, 0, width, height);
+
       y = (height - (widget->style->font->ascent + widget->style->font->descent)) / 2;
       y += widget->style->font->ascent;
 
@@ -1358,37 +1356,35 @@ gtk_entry_draw_text (GtkEntry *entry)
       if (selection_start_pos > start_pos)
        gdk_draw_text (drawable, widget->style->font,
                       widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
-                      start_xoffset, y,
+                      INNER_BORDER + start_xoffset, y,
                       toprint,
                       selection_start_pos - start_pos);
       
       if ((selection_end_pos >= start_pos) && 
          (selection_start_pos < end_pos) &&
          (selection_start_pos != selection_end_pos))
-       {
-         gdk_draw_rectangle (drawable,
-                             widget->style->bg_gc[selected_state],
-                             TRUE,
-                             selection_start_xoffset,
-                             0,
-                             selection_end_xoffset - selection_start_xoffset,
-                             -1);
-         
-         gdk_draw_text (drawable, widget->style->font,
-                        widget->style->fg_gc[selected_state],
-                        selection_start_xoffset, y,
-                        toprint + selection_start_pos - start_pos,
-                        selection_end_pos - selection_start_pos);
-       }           
-      
-      if (selection_end_pos < end_pos)
-       gdk_draw_text (drawable, widget->style->font,
-                      widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
-                      selection_end_xoffset, y,
-                      toprint + selection_end_pos - start_pos,
-                      end_pos - selection_end_pos);
-      
-      /* free the space allocated for the stars if it's neccessary. */
+        {
+           gtk_paint_flat_box (widget->style, drawable, 
+                               selected_state, GTK_SHADOW_NONE,
+                               NULL, widget, "text",
+                               INNER_BORDER + selection_start_xoffset,
+                               INNER_BORDER,
+                               selection_end_xoffset - selection_start_xoffset,
+                               height - 2*INNER_BORDER);
+           gdk_draw_text (drawable, widget->style->font,
+                          widget->style->fg_gc[selected_state],
+                          INNER_BORDER + selection_start_xoffset, y,
+                          toprint + selection_start_pos - start_pos,
+                          selection_end_pos - selection_start_pos);
+        }          
+       
+       if (selection_end_pos < end_pos)
+        gdk_draw_text (drawable, widget->style->font,
+                       widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+                       INNER_BORDER + selection_end_xoffset, y,
+                       toprint + selection_end_pos - start_pos,
+                       end_pos - selection_end_pos);
+       /* free the space allocated for the stars if it's neccessary. */
       if (!entry->visible)
        g_free (toprint);
 
@@ -1417,7 +1413,6 @@ gtk_entry_draw_cursor_on_drawable (GtkEntry *entry, GdkDrawable *drawable)
 {
   GtkWidget *widget;
   GtkEditable *editable;
-  GdkGC *gc;
   gint xoffset;
   gint text_area_height;
 
@@ -1429,17 +1424,25 @@ gtk_entry_draw_cursor_on_drawable (GtkEntry *entry, GdkDrawable *drawable)
       widget = GTK_WIDGET (entry);
       editable = GTK_EDITABLE (entry);
 
-      xoffset = entry->char_offset[gtk_entry_find_char (entry, editable->current_pos)];
+      xoffset = INNER_BORDER + entry->char_offset[gtk_entry_find_char (entry, editable->current_pos)];
       xoffset -= entry->scroll_offset;
 
+      gdk_window_get_size (entry->text_area, NULL, &text_area_height);
+
       if (GTK_WIDGET_HAS_FOCUS (widget) &&
          (editable->selection_start_pos == editable->selection_end_pos))
-       gc = widget->style->fg_gc[GTK_STATE_NORMAL];
+       {
+         gdk_draw_line (drawable, widget->style->fg_gc[GTK_STATE_NORMAL], 
+                        xoffset, 0, xoffset, text_area_height);
+       }
       else
-       gc = widget->style->base_gc[GTK_WIDGET_STATE(widget)];
+       {
+         gtk_paint_flat_box (widget->style, drawable,
+                             GTK_WIDGET_STATE(widget), GTK_SHADOW_NONE,
+                             NULL, widget, "entry_bg", 
+                             xoffset, 0, 1, text_area_height);
+       }
 
-      gdk_window_get_size (entry->text_area, NULL, &text_area_height);
-      gdk_draw_line (drawable, gc, xoffset, 0, xoffset, text_area_height);
 #ifdef USE_XIM
       if (gdk_im_ready() && editable->ic && 
          gdk_ic_get_style (editable->ic) & GDK_IM_PREEDIT_POSITION)
@@ -2321,7 +2324,7 @@ gtk_entry_style_set       (GtkWidget      *widget,
     }
 
   if (GTK_WIDGET_DRAWABLE (widget))
-    gdk_window_clear (widget->window);
+    gtk_widget_queue_clear(widget);
 }
 
 static void
@@ -2338,5 +2341,5 @@ gtk_entry_state_changed (GtkWidget      *widget,
     }
 
   if (GTK_WIDGET_DRAWABLE (widget))
-    gdk_window_clear (widget->window);
+    gtk_widget_queue_clear(widget);
 }
index 9b88198de1b37cac24d927818dd139d8441eb302..726a94b2eea75110446d9d115a444743db964777 100644 (file)
@@ -346,7 +346,7 @@ gtk_fixed_paint (GtkWidget    *widget,
   g_return_if_fail (area != NULL);
 
   if (GTK_WIDGET_DRAWABLE (widget))
-      gdk_window_clear_area (widget->window,
+     gdk_window_clear_area (widget->window,
                             area->x, area->y,
                             area->width, area->height);
 }
index d11a578597b5ab46c3be6eedc42564fea9d85e61..93414fa113916b770fe8b2d3503dd6345f922915 100644 (file)
@@ -242,11 +242,11 @@ gtk_frame_set_label (GtkFrame *frame,
       /* clear the old label area
       */
       widget = GTK_WIDGET (frame);
-      gdk_window_clear_area (widget->window,
-                             widget->allocation.x + GTK_CONTAINER (frame)->border_width,
-                             widget->allocation.y + GTK_CONTAINER (frame)->border_width,
-                             widget->allocation.width - GTK_CONTAINER (frame)->border_width,
-                             widget->allocation.y + frame->label_height);
+      gtk_widget_queue_clear_area (widget,
+                                  widget->allocation.x + GTK_CONTAINER (frame)->border_width,
+                                  widget->allocation.y + GTK_CONTAINER (frame)->border_width,
+                                  widget->allocation.width - GTK_CONTAINER (frame)->border_width,
+                                  widget->allocation.y + frame->label_height);
 
     }
   
@@ -276,11 +276,11 @@ gtk_frame_set_label_align (GtkFrame *frame,
           /* clear the old label area
           */
           widget = GTK_WIDGET (frame);
-          gdk_window_clear_area (widget->window,
-                                 widget->allocation.x + GTK_CONTAINER (frame)->border_width,
-                                 widget->allocation.y + GTK_CONTAINER (frame)->border_width,
-                                 widget->allocation.width - GTK_CONTAINER (frame)->border_width,
-                                 widget->allocation.y + frame->label_height);
+          gtk_widget_queue_clear_area (widget,
+                                      widget->allocation.x + GTK_CONTAINER (frame)->border_width,
+                                      widget->allocation.y + GTK_CONTAINER (frame)->border_width,
+                                      widget->allocation.width - GTK_CONTAINER (frame)->border_width,
+                                      widget->allocation.y + frame->label_height);
 
        }
       gtk_widget_queue_resize (GTK_WIDGET (frame));
@@ -300,11 +300,7 @@ gtk_frame_set_shadow_type (GtkFrame      *frame,
 
       if (GTK_WIDGET_DRAWABLE (frame))
        {
-         gdk_window_clear_area (GTK_WIDGET (frame)->window,
-                                GTK_WIDGET (frame)->allocation.x,
-                                GTK_WIDGET (frame)->allocation.y,
-                                GTK_WIDGET (frame)->allocation.width,
-                                GTK_WIDGET (frame)->allocation.height);
+         gtk_widget_queue_clear (GTK_WIDGET (frame));
        }
       gtk_widget_queue_resize (GTK_WIDGET (frame));
     }
@@ -334,7 +330,7 @@ gtk_frame_paint (GtkWidget    *widget,
   GtkFrame *frame;
   gint height_extra;
   gint label_area_width;
-  gint x, y;
+  gint x, y, x2, y2;
 
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_FRAME (widget));
@@ -350,33 +346,40 @@ gtk_frame_paint (GtkWidget    *widget,
       x = GTK_CONTAINER (frame)->border_width;
       y = GTK_CONTAINER (frame)->border_width;
 
-      gtk_draw_shadow (widget->style, widget->window,
-                      GTK_STATE_NORMAL, frame->shadow_type,
-                      widget->allocation.x + x,
-                      widget->allocation.y + y + height_extra / 2,
-                      widget->allocation.width - x * 2,
-                      widget->allocation.height - y * 2 - height_extra / 2);
-
       if (frame->label)
        {
-         label_area_width = (widget->allocation.width -
-                             GTK_CONTAINER (frame)->border_width * 2 -
-                             widget->style->klass->xthickness * 2);
-
-         x = ((label_area_width - frame->label_width) * frame->label_xalign +
-              GTK_CONTAINER (frame)->border_width + widget->style->klass->xthickness);
-         y = (GTK_CONTAINER (frame)->border_width + widget->style->font->ascent);
-
-         gdk_window_clear_area (widget->window,
-                                widget->allocation.x + x + 2,
-                                widget->allocation.y + GTK_CONTAINER (frame)->border_width,
-                                frame->label_width - 4,
-                                frame->label_height);
-         gtk_draw_string (widget->style, widget->window, GTK_WIDGET_STATE (widget),
-                          widget->allocation.x + x + 3,
-                          widget->allocation.y + y,
-                          frame->label);
+          label_area_width = (widget->allocation.width -
+                              GTK_CONTAINER (frame)->border_width * 2 -
+                              widget->style->klass->xthickness * 2);
+          
+          x2 = ((label_area_width - frame->label_width) * frame->label_xalign +
+               GTK_CONTAINER (frame)->border_width + widget->style->klass->xthickness);
+          y2 = (GTK_CONTAINER (frame)->border_width + widget->style->font->ascent);
+
+          gtk_paint_shadow_gap (widget->style, widget->window,
+                                GTK_STATE_NORMAL, frame->shadow_type,
+                                area, widget, "frame",
+                                widget->allocation.x + x,
+                                widget->allocation.y + y + height_extra / 2,
+                                widget->allocation.width - x * 2,
+                                widget->allocation.height - y * 2 - height_extra / 2,
+                                GTK_POS_TOP, 
+                                x2 + 2 - x, frame->label_width - 4);
+          
+          gtk_paint_string (widget->style, widget->window, GTK_WIDGET_STATE (widget),
+                            area, widget, "frame",
+                            widget->allocation.x + x2 + 3,
+                            widget->allocation.y + y2,
+                            frame->label);
        }
+       else
+        gtk_paint_shadow (widget->style, widget->window,
+                          GTK_STATE_NORMAL, frame->shadow_type,
+                          area, widget, "frame",
+                          widget->allocation.x + x,
+                          widget->allocation.y + y + height_extra / 2,
+                          widget->allocation.width - x * 2,
+                          widget->allocation.height - y * 2 - height_extra / 2);
     }
 }
 
@@ -488,11 +491,7 @@ gtk_frame_size_allocate (GtkWidget     *widget,
        (widget->allocation.height != allocation->height)) &&
       (widget->allocation.width != 0) &&
       (widget->allocation.height != 0))
-    gdk_window_clear_area (widget->window,
-                          widget->allocation.x,
-                          widget->allocation.y,
-                          widget->allocation.width,
-                          widget->allocation.height);
+     gtk_widget_queue_clear (widget);
 
   widget->allocation = *allocation;
 
index 18f0e32f3de15f946a15a6b696be7c1e06f976bd..a4d8bac2997f1e8bca30d36dbdbf8c906d7384dd 100644 (file)
@@ -308,6 +308,7 @@ gtk_handle_box_realize (GtkWidget *widget)
   gtk_style_set_background (widget->style, widget->window, GTK_WIDGET_STATE (hb));
   gtk_style_set_background (widget->style, hb->bin_window, GTK_WIDGET_STATE (hb));
   gtk_style_set_background (widget->style, hb->float_window, GTK_WIDGET_STATE (hb));
+  gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
 }
 
 static void
@@ -567,77 +568,42 @@ gtk_handle_box_draw_ghost (GtkHandleBox *hb)
       width = widget->allocation.width;
       height = DRAG_HANDLE_SIZE;
     }
-  gtk_draw_shadow (widget->style,
-                  widget->window,
-                  GTK_WIDGET_STATE (widget),
-                  GTK_SHADOW_ETCHED_IN,
-                  x,
-                  y,
-                  width,
-                  height);
-  /*
-  if (hb->handle_position == GTK_POS_LEFT ||
-      hb->handle_position == GTK_POS_RIGHT)
-    gtk_draw_hline (widget->style,
-                   widget->window,
-                   GTK_WIDGET_STATE (widget),
-                   hb->handle_position == GTK_POS_LEFT ? DRAG_HANDLE_SIZE : widget->allocation.width - DRAG_HANDLE_SIZE,
-                   widget->allocation.width - DRAG_HANDLE_SIZE,
-                   widget->allocation.height / 2);
-  else
-    gtk_draw_vline (widget->style,
+  gtk_paint_shadow (widget->style,
                    widget->window,
                    GTK_WIDGET_STATE (widget),
-                   hb->handle_position == GTK_POS_TOP ? DRAG_HANDLE_SIZE : widget->allocation.height - DRAG_HANDLE_SIZE,
-                   widget->allocation.height - DRAG_HANDLE_SIZE,
-                   widget->allocation.width / 2);
-                   */
+                   GTK_SHADOW_ETCHED_IN,
+                   NULL, widget, "handle",
+                   x,
+                   y,
+                   width,
+                   height);
+   if (hb->handle_position == GTK_POS_LEFT ||
+       hb->handle_position == GTK_POS_RIGHT)
+     gtk_paint_hline (widget->style,
+                     widget->window,
+                     GTK_WIDGET_STATE (widget),
+                     NULL, widget, "handlebox",
+                     hb->handle_position == GTK_POS_LEFT ? DRAG_HANDLE_SIZE : widget->allocation.width - DRAG_HANDLE_SIZE,
+                     widget->allocation.width - DRAG_HANDLE_SIZE,
+                     widget->allocation.height / 2);
+   else
+     gtk_paint_vline (widget->style,
+                     widget->window,
+                     GTK_WIDGET_STATE (widget),
+                     NULL, widget, "handlebox",
+                     hb->handle_position == GTK_POS_TOP ? DRAG_HANDLE_SIZE : widget->allocation.height - DRAG_HANDLE_SIZE,
+                     widget->allocation.height - DRAG_HANDLE_SIZE,
+                     widget->allocation.width / 2);
 }
 
 static void
 draw_textured_frame (GtkWidget *widget, GdkWindow *window, GdkRectangle *rect, GtkShadowType shadow,
                     GdkRectangle *clip)
 {
-  int x, y;
-  int xthick, ythick;
-  GdkGC *light_gc, *dark_gc;
-  GdkRectangle dest;
-
-  if (gdk_rectangle_intersect (rect, clip, &dest))
-    {
-      gdk_draw_rectangle (window,
-                         widget->style->bg_gc[GTK_STATE_NORMAL],
-                         TRUE,
-                         dest.x, dest.y,
-                         dest.width, dest.height);
-
-      light_gc = widget->style->light_gc[GTK_STATE_NORMAL];
-      dark_gc = widget->style->dark_gc[GTK_STATE_NORMAL];
-
-      xthick = widget->style->klass->xthickness;
-      ythick = widget->style->klass->ythickness;
-
-      gdk_gc_set_clip_rectangle (light_gc, &dest);
-      gdk_gc_set_clip_rectangle (dark_gc, &dest);
-
-      for (y = rect->y + ythick; y < (rect->y + rect->height - ythick); y += 3)
-       for (x = rect->x + xthick; x < (rect->x + rect->width - xthick); x += 6)
-         {
-           gdk_draw_point (window, light_gc, x, y);
-           gdk_draw_point (window, dark_gc, x + 1, y + 1);
-
-           gdk_draw_point (window, light_gc, x + 3, y + 1);
-           gdk_draw_point (window, dark_gc, x + 4, y + 2);
-         }
-       
-      gdk_gc_set_clip_rectangle (light_gc, NULL);
-      gdk_gc_set_clip_rectangle (dark_gc, NULL);
-
-      gtk_draw_shadow (widget->style, window,
-                      GTK_STATE_NORMAL, shadow,
-                      rect->x, rect->y,
-                      rect->width, rect->height);
-    }
+   gtk_paint_handle(widget->style, window, GTK_STATE_NORMAL, shadow,
+                   NULL, widget, "handlebox",
+                   rect->x, rect->y, rect->width, rect->height, 
+                   GTK_ORIENTATION_VERTICAL);
 }
 
 static void
@@ -673,22 +639,29 @@ gtk_handle_box_paint (GtkWidget      *widget,
       width = widget->allocation.width;
       height = widget->allocation.height - DRAG_HANDLE_SIZE;
     }
-  
+
   if (!event)
-    gdk_window_clear_area (hb->bin_window,
-                          area->x,
-                          area->y,
-                          area->width,
-                          area->height);
-
-  gtk_draw_shadow (widget->style,
-                  hb->bin_window,
-                  GTK_WIDGET_STATE (widget),
-                  GTK_SHADOW_OUT,
-                  hb->handle_position == GTK_POS_LEFT ? DRAG_HANDLE_SIZE : 0,
-                  hb->handle_position == GTK_POS_TOP ? DRAG_HANDLE_SIZE : 0,
-                  width,
-                  height);
+   gtk_paint_box(widget->style,
+                hb->bin_window,
+                GTK_WIDGET_STATE (widget),
+                GTK_SHADOW_OUT,
+                area, widget, "handlebox_bin",
+                0, 0, -1, -1);
+  else
+   gtk_paint_box(widget->style,
+                hb->bin_window,
+                GTK_WIDGET_STATE (widget),
+                GTK_SHADOW_OUT,
+                &event->area, widget, "handlebox_bin",
+                0, 0, -1, -1);
+
+/* We currently draw the handle _above_ the relief of the handlebox.
+ * it could also be drawn on the same level...
+
+                hb->handle_position == GTK_POS_LEFT ? DRAG_HANDLE_SIZE : 0,
+                hb->handle_position == GTK_POS_TOP ? DRAG_HANDLE_SIZE : 0,
+                width,
+                height);*/
 
   rect.x = 0;
   rect.y = 0; 
index e828de2b3a500917aa2a2138585ed8e2a3ad9ace..4312575f82329f6ec38c43d9e93e2a50420f8ea6 100644 (file)
@@ -229,6 +229,8 @@ gtk_hpaned_draw (GtkWidget    *widget,
       paned = GTK_PANED (widget);
       border_width = GTK_CONTAINER (paned)->border_width;
 
+      gdk_window_clear_area (widget->window,
+                            area->x, area->y, area->width, area->height);
       if (paned->child1 &&
          gtk_widget_intersect (paned->child1, area, &child_area))
         gtk_widget_draw (paned->child1, &child_area);
@@ -236,18 +238,10 @@ gtk_hpaned_draw (GtkWidget    *widget,
          gtk_widget_intersect (paned->child2, area, &child_area))
         gtk_widget_draw (paned->child2, &child_area);
 
-      gdk_draw_line (widget->window,
-                    widget->style->dark_gc[widget->state],
-                    border_width + paned->child1_size + paned->gutter_size / 2 - 1,
-                    0,
-                    border_width + paned->child1_size + paned->gutter_size / 2 - 1,
-                    widget->allocation.height - 1);
-      gdk_draw_line (widget->window,
-                    widget->style->light_gc[widget->state],
-                    border_width + paned->child1_size + paned->gutter_size / 2,
-                    0,
-                    border_width + paned->child1_size + paned->gutter_size / 2,
-                    widget->allocation.height - 1);
+      gtk_paint_vline(widget->style, widget->window, GTK_STATE_NORMAL,
+                     area, widget, "hpaned", 
+                     0, widget->allocation.height - 1,
+                     border_width + paned->child1_size + paned->gutter_size / 2 - 1);
     }
 }
 
index 0a8b6307c5175c85352ad9273965db034b9ae3e3..40af247119424766d2a333d6fb9f5859ea0f3c00 100644 (file)
@@ -162,7 +162,15 @@ gtk_hruler_draw_ticks (GtkRuler *ruler)
   width = widget->allocation.width;
   height = widget->allocation.height - ythickness * 2;
 
-  gdk_draw_line (ruler->backing_store, gc,
+   
+   gtk_paint_box (widget->style, ruler->backing_store,
+                 GTK_STATE_NORMAL, GTK_SHADOW_OUT, 
+                 NULL, widget, "hruler",
+                 0, 0, 
+                 widget->allocation.width, widget->allocation.height);
+
+
+   gdk_draw_line (ruler->backing_store, gc,
                 xthickness,
                 height + ythickness,
                 widget->allocation.width - xthickness,
@@ -231,11 +239,6 @@ gtk_hruler_draw_ticks (GtkRuler *ruler)
          if (i == 0)
            {
              sprintf (unit_str, "%d", (int) cur);
-             gdk_draw_rectangle (ruler->backing_store,
-                                 bg_gc, TRUE,
-                                 pos + 1, ythickness,
-                                 gdk_string_width(font, unit_str) + 1,
-                                 digit_height);
              gdk_draw_string (ruler->backing_store, font, gc,
                               pos + 2, ythickness + font->ascent - 1,
                               unit_str);
index 96ec88941568015b99f789298b79fe21724e0c22..e4559fb12cdb48178edec1417b37d81846be8d2d 100644 (file)
@@ -38,12 +38,20 @@ static void gtk_hscale_pos_trough    (GtkHScale      *hscale,
                                      gint           *y,
                                      gint           *w,
                                      gint           *h);
+static void gtk_hscale_pos_background (GtkHScale     *hscale,
+                                      gint          *x,
+                                      gint          *y,
+                                      gint          *w,
+                                      gint          *h);
 static void gtk_hscale_draw_slider   (GtkRange       *range);
 static void gtk_hscale_draw_value    (GtkScale       *scale);
+static void gtk_hscale_draw          (GtkWidget      *widget,
+                                     GdkRectangle   *area);
 static gint gtk_hscale_trough_keys   (GtkRange *range,
                                      GdkEventKey *key,
                                      GtkScrollType *scroll,
                                      GtkTroughType *pos);
+static void gtk_hscale_clear_background (GtkRange    *range);
 
 guint
 gtk_hscale_get_type (void)
@@ -84,12 +92,14 @@ gtk_hscale_class_init (GtkHScaleClass *class)
   widget_class->realize = gtk_hscale_realize;
   widget_class->size_request = gtk_hscale_size_request;
   widget_class->size_allocate = gtk_hscale_size_allocate;
+  widget_class->draw = gtk_hscale_draw;
 
   range_class->slider_update = gtk_range_default_hslider_update;
   range_class->trough_click = gtk_range_default_htrough_click;
   range_class->motion = gtk_range_default_hmotion;
   range_class->draw_slider = gtk_hscale_draw_slider;
   range_class->trough_keys = gtk_hscale_trough_keys;
+  range_class->clear_background = gtk_hscale_clear_background;
 
   scale_class->draw_value = gtk_hscale_draw_value;
 }
@@ -97,6 +107,7 @@ gtk_hscale_class_init (GtkHScaleClass *class)
 static void
 gtk_hscale_init (GtkHScale *hscale)
 {
+  GTK_WIDGET_SET_FLAGS (hscale, GTK_NO_WINDOW);
 }
 
 GtkWidget*
@@ -129,28 +140,27 @@ gtk_hscale_realize (GtkWidget *widget)
   GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
   range = GTK_RANGE (widget);
 
-  attributes.x = widget->allocation.x;
-  attributes.y = widget->allocation.y;
-  attributes.width = widget->allocation.width;
-  attributes.height = widget->allocation.height;
+  widget->window = gtk_widget_get_parent_window (widget);
+  gdk_window_ref (widget->window);
+
+  gtk_hscale_pos_trough (GTK_HSCALE (widget), &x, &y, &w, &h);
+  attributes.x = x + widget->allocation.x;
+  attributes.y = y + widget->allocation.y;
+  attributes.width = w;
+  attributes.height = h;
   attributes.wclass = GDK_INPUT_OUTPUT;
   attributes.window_type = GDK_WINDOW_CHILD;
-  attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;
+  
+  attributes.event_mask = gtk_widget_get_events (widget) | 
+                            (GDK_EXPOSURE_MASK |
+                             GDK_BUTTON_PRESS_MASK |
+                            GDK_BUTTON_RELEASE_MASK |
+                            GDK_ENTER_NOTIFY_MASK |
+                            GDK_LEAVE_NOTIFY_MASK);
   attributes.visual = gtk_widget_get_visual (widget);
   attributes.colormap = gtk_widget_get_colormap (widget);
 
   attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
-  widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
-
-  gtk_hscale_pos_trough (GTK_HSCALE (widget), &x, &y, &w, &h);
-  attributes.x = x;
-  attributes.y = y;
-  attributes.width = w;
-  attributes.height = h;
-  attributes.event_mask |= (GDK_BUTTON_PRESS_MASK |
-                           GDK_BUTTON_RELEASE_MASK |
-                           GDK_ENTER_NOTIFY_MASK |
-                           GDK_LEAVE_NOTIFY_MASK);
 
   range->trough = gdk_window_new (widget->window, &attributes, attributes_mask);
 
@@ -163,18 +173,75 @@ gtk_hscale_realize (GtkWidget *widget)
 
   widget->style = gtk_style_attach (widget->style, widget->window);
 
-  gdk_window_set_user_data (widget->window, widget);
   gdk_window_set_user_data (range->trough, widget);
   gdk_window_set_user_data (range->slider, widget);
 
-  gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
   gtk_style_set_background (widget->style, range->trough, GTK_STATE_ACTIVE);
   gtk_style_set_background (widget->style, range->slider, GTK_STATE_NORMAL);
 
   gtk_range_slider_update (GTK_RANGE (widget));
 
   gdk_window_show (range->slider);
-  gdk_window_show (range->trough);
+}
+
+static void
+gtk_hscale_draw (GtkWidget    *widget,
+                GdkRectangle *area)
+{
+  GtkRange *range;
+  GdkRectangle tmp_area;
+  GdkRectangle child_area;
+  gint x, y, width, height;
+
+  g_return_if_fail (widget != NULL);
+  g_return_if_fail (GTK_IS_RANGE (widget));
+  g_return_if_fail (area != NULL);
+
+  if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget))
+    {
+      range = GTK_RANGE (widget);
+
+      gtk_hscale_pos_background (GTK_HSCALE (widget), &x, &y, &width, &height);
+
+      tmp_area.x = x;
+      tmp_area.y = y;
+      tmp_area.width = width;
+      tmp_area.height = height;
+
+      if (gdk_rectangle_intersect (area, &tmp_area, &child_area))
+       gtk_range_draw_background (range);
+
+      gtk_hscale_pos_trough (GTK_HSCALE (widget), &x, &y, &width, &height);
+
+      tmp_area.x = x;
+      tmp_area.y = y;
+      tmp_area.width = width;
+      tmp_area.height = height;
+
+      if (gdk_rectangle_intersect (area, &tmp_area, &child_area))
+       {
+         gtk_range_draw_trough (range);
+         gtk_range_draw_slider (range);
+         gtk_range_draw_step_forw (range);
+         gtk_range_draw_step_back (range);
+       }
+    }
+}
+
+static void 
+gtk_hscale_clear_background (GtkRange    *range)
+{
+  GtkWidget *widget;
+  gint x, y, width, height;
+
+  g_return_if_fail (range != NULL);
+
+  widget = GTK_WIDGET (range);
+  
+  gtk_hscale_pos_background (GTK_HSCALE (range), &x, &y, &width, &height);
+
+  gtk_widget_queue_clear_area (GTK_WIDGET (range),
+                              x, y, width, height);
 }
 
 static void
@@ -235,13 +302,11 @@ gtk_hscale_size_allocate (GtkWidget     *widget,
       range = GTK_RANGE (widget);
       scale = GTK_SCALE (widget);
 
-      gdk_window_move_resize (widget->window,
-                             allocation->x, allocation->y,
-                             allocation->width, allocation->height);
-
       gtk_hscale_pos_trough (GTK_HSCALE (widget), &x, &y, &width, &height);
 
-      gdk_window_move_resize (range->trough, x, y, width, height);
+      gdk_window_move_resize (range->trough, 
+                             x + widget->allocation.x, 
+                             y + widget->allocation.y, width, height);
       gtk_range_slider_update (GTK_RANGE (widget));
     }
 }
@@ -301,11 +366,55 @@ gtk_hscale_pos_trough (GtkHScale *hscale,
   *w -= 2;
 }
 
+static void
+gtk_hscale_pos_background (GtkHScale *hscale,
+                          gint      *x,
+                          gint      *y,
+                          gint      *w,
+                          gint      *h)
+{
+  GtkWidget *widget;
+  GtkScale *scale;
+
+  gint tx, ty, twidth, theight;
+
+  g_return_if_fail (hscale != NULL);
+  g_return_if_fail (GTK_IS_HSCALE (hscale));
+  g_return_if_fail ((x != NULL) && (y != NULL) && (w != NULL) && (h != NULL));
+
+  gtk_hscale_pos_trough (hscale, &tx, &ty, &twidth, &theight);
+  
+  widget = GTK_WIDGET (hscale);
+  scale = GTK_SCALE (hscale);
+
+  *x = widget->allocation.x;
+  *y = widget->allocation.y;
+  *w = widget->allocation.width;
+  *h = widget->allocation.height;
+
+  switch (scale->value_pos)
+    {
+    case GTK_POS_LEFT:
+      *w -= twidth;
+      break;
+    case GTK_POS_RIGHT:
+      *x = tx;
+      *w -= twidth;
+      break;
+    case GTK_POS_TOP:
+      *h -= theight;
+      break;
+    case GTK_POS_BOTTOM:
+      *y = ty;
+      *h -= theight;
+      break;
+    }
+}
+
 static void
 gtk_hscale_draw_slider (GtkRange *range)
 {
   GtkStateType state_type;
-  gint width, height;
 
   g_return_if_fail (range != NULL);
   g_return_if_fail (GTK_IS_HSCALE (range));
@@ -318,16 +427,11 @@ gtk_hscale_draw_slider (GtkRange *range)
       else
         state_type = GTK_STATE_NORMAL;
 
-      gtk_style_set_background (GTK_WIDGET (range)->style, range->slider, state_type);
-      gdk_window_clear (range->slider);
-
-      gdk_window_get_size (range->slider, &width, &height);
-      gtk_draw_vline (GTK_WIDGET (range)->style, range->slider,
-                     state_type, 1, height - 2, width / 2);
-
-      gtk_draw_shadow (GTK_WIDGET (range)->style, range->slider,
-                       state_type, GTK_SHADOW_OUT,
-                       0, 0, -1, -1);
+       gtk_paint_slider(GTK_WIDGET (range)->style, range->slider, state_type, 
+                       GTK_SHADOW_OUT,
+                       NULL, GTK_WIDGET (range), "hscale",
+                       0, 0, -1, -1, 
+                       GTK_ORIENTATION_HORIZONTAL); 
     }
 }
 
@@ -335,6 +439,7 @@ static void
 gtk_hscale_draw_value (GtkScale *scale)
 {
   GtkStateType state_type;
+  GtkWidget *widget;
   gchar buffer[32];
   gint text_width;
   gint width, height;
@@ -343,11 +448,10 @@ gtk_hscale_draw_value (GtkScale *scale)
   g_return_if_fail (scale != NULL);
   g_return_if_fail (GTK_IS_HSCALE (scale));
 
+  widget = GTK_WIDGET (scale);
+  
   if (scale->draw_value)
     {
-      gdk_window_get_size (GTK_WIDGET (scale)->window, &width, &height);
-      gdk_window_clear_area (GTK_WIDGET (scale)->window, 1, 1, width - 2, height - 2);
-
       sprintf (buffer, "%0.*f", GTK_RANGE (scale)->digits, GTK_RANGE (scale)->adjustment->value);
       text_width = gdk_string_measure (GTK_WIDGET (scale)->style->font, buffer);
 
@@ -379,7 +483,7 @@ gtk_hscale_draw_value (GtkScale *scale)
          gdk_window_get_size (GTK_RANGE (scale)->slider, &width, NULL);
          gdk_window_get_size (GTK_RANGE (scale)->trough, NULL, &height);
 
-         x += (width - text_width) / 2;
+         x += widget->allocation.x + (width - text_width) / 2;
          y -= GTK_WIDGET (scale)->style->font->descent;
          break;
        case GTK_POS_BOTTOM:
@@ -388,7 +492,7 @@ gtk_hscale_draw_value (GtkScale *scale)
          gdk_window_get_size (GTK_RANGE (scale)->slider, &width, NULL);
          gdk_window_get_size (GTK_RANGE (scale)->trough, NULL, &height);
 
-         x += (width - text_width) / 2;
+         x += widget->allocation.x + (width - text_width) / 2;
          y += height + GTK_WIDGET (scale)->style->font->ascent;
          break;
        }
@@ -397,9 +501,11 @@ gtk_hscale_draw_value (GtkScale *scale)
       if (!GTK_WIDGET_IS_SENSITIVE (scale))
        state_type = GTK_STATE_INSENSITIVE;
 
-      gtk_draw_string (GTK_WIDGET (scale)->style,
-                      GTK_WIDGET (scale)->window,
-                      state_type, x, y, buffer);
+       gtk_paint_string (GTK_WIDGET (scale)->style,
+                        GTK_WIDGET (scale)->window,
+                        state_type, 
+                        NULL, GTK_WIDGET (scale), "hscale", 
+                        x, y, buffer);
     }
 }
 
index c8c1bbc9b5fa2a47088ae8d150851cf1b6a2b5b4..7b38db6486c638ec2a8ea46b3e8cd787a5122e63 100644 (file)
@@ -259,9 +259,11 @@ gtk_hscrollbar_draw_step_forw (GtkRange *range)
       else
        shadow_type = GTK_SHADOW_OUT;
 
-      gtk_draw_arrow (GTK_WIDGET (range)->style, range->step_forw,
-                     state_type, shadow_type, GTK_ARROW_RIGHT,
-                     TRUE, 0, 0, -1, -1);
+      gtk_paint_arrow (GTK_WIDGET (range)->style, range->step_forw,
+                      state_type, shadow_type, 
+                      NULL, GTK_WIDGET (range), "hscrollbar",
+                      GTK_ARROW_RIGHT,
+                      TRUE, 0, 0, -1, -1);
     }
 }
 
@@ -291,9 +293,11 @@ gtk_hscrollbar_draw_step_back (GtkRange *range)
       else
        shadow_type = GTK_SHADOW_OUT;
 
-      gtk_draw_arrow (GTK_WIDGET (range)->style, range->step_back,
-                     state_type, shadow_type, GTK_ARROW_LEFT,
-                     TRUE, 0, 0, -1, -1);
+       gtk_paint_arrow (GTK_WIDGET (range)->style, range->step_back,
+                       state_type, shadow_type, 
+                       NULL, GTK_WIDGET (range), "hscrollbar",
+                       GTK_ARROW_LEFT,
+                       TRUE, 0, 0, -1, -1);
     }
 }
 
index 88cd4642f91dadf65ef82e22644dbe77138ac55a..16b5908a270f1535d0ba912de6b004f1f2844091 100644 (file)
@@ -83,11 +83,12 @@ gtk_hseparator_expose (GtkWidget      *widget,
   g_return_val_if_fail (event != NULL, FALSE);
 
   if (GTK_WIDGET_DRAWABLE (widget))
-    gtk_draw_hline (widget->style, widget->window, GTK_STATE_NORMAL,
-                   widget->allocation.x,
-                   widget->allocation.x + widget->allocation.width,
-                   widget->allocation.y + (widget->allocation.height -
-                                           widget->style->klass->ythickness) / 2);
+    gtk_paint_hline (widget->style, widget->window, GTK_STATE_NORMAL,
+                    &event->area, widget, "hseparator",
+                    widget->allocation.x,
+                    widget->allocation.x + widget->allocation.width,
+                    widget->allocation.y + (widget->allocation.height -
+                                            widget->style->klass->ythickness) / 2);
 
   return FALSE;
 }
index 9abb9ba0f5b161e7f5cc065e2ef16c3cea92947c..0cbe8d135404adefd3e4704a6266b8a4cb2f868a 100644 (file)
@@ -26,7 +26,6 @@
 
 #ifdef __cplusplus
 extern "C" {
-#pragma }
 #endif /* __cplusplus */
 
 
index 825614d0b4e4a5af4836789aa5fa2029757aefcb..96132634420b93fde399c5085745f89da5e09fe3 100644 (file)
@@ -201,6 +201,7 @@ gtk_item_realize (GtkWidget *widget)
 
   widget->style = gtk_style_attach (widget->style, widget->window);
   gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
+   gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
 }
 
 static gint
index 3c920cd2bc8314dea86ad4d037f0a1517335a5ce..18a167712eade8574efc62e300cce3ebc8225a8e 100644 (file)
@@ -51,12 +51,7 @@ static void gtk_label_size_request (GtkWidget           *widget,
                                    GtkRequisition *requisition);
 static gint gtk_label_expose      (GtkWidget      *widget,
                                    GdkEventExpose *event);
-static void gtk_label_state_changed (GtkWidget     *widget,
-                                    guint           previous_state);
-static void gtk_label_style_set            (GtkWidget      *widget,
-                                    GtkStyle       *previous_style);
-static void gtk_label_free_rows     (GtkLabel       *label);
-
+static void gtk_label_free_rows    (GtkLabel       *label);
 
 
 static GtkMiscClass *parent_class = NULL;
@@ -109,8 +104,6 @@ gtk_label_class_init (GtkLabelClass *class)
   
   widget_class->size_request = gtk_label_size_request;
   widget_class->expose_event = gtk_label_expose;
-  widget_class->style_set    = gtk_label_style_set;
-  widget_class->state_changed = gtk_label_state_changed;
 }
 
 static void
@@ -173,7 +166,6 @@ gtk_label_init (GtkLabel *label)
   label->row = NULL;
   label->max_width = 0;
   label->jtype = GTK_JUSTIFY_CENTER;
-  label->needs_clear = FALSE;
   label->pattern = NULL;
   
   gtk_label_set (label, "");
@@ -233,12 +225,8 @@ gtk_label_set (GtkLabel       *label,
   if (GTK_WIDGET_VISIBLE (label))
     {
       if (GTK_WIDGET_MAPPED (label))
-       gdk_window_clear_area (GTK_WIDGET (label)->window,
-                              GTK_WIDGET (label)->allocation.x,
-                              GTK_WIDGET (label)->allocation.y,
-                              GTK_WIDGET (label)->allocation.width,
-                              GTK_WIDGET (label)->allocation.height);
-      
+       gtk_widget_queue_clear (GTK_WIDGET (label));
+
       gtk_widget_queue_resize (GTK_WIDGET (label));
     }
 }
@@ -257,11 +245,7 @@ gtk_label_set_pattern (GtkLabel       *label,
   if (GTK_WIDGET_VISIBLE (label))
     {
       if (GTK_WIDGET_MAPPED (label))
-       gdk_window_clear_area (GTK_WIDGET (label)->window,
-                              GTK_WIDGET (label)->allocation.x,
-                              GTK_WIDGET (label)->allocation.y,
-                              GTK_WIDGET (label)->allocation.width,
-                              GTK_WIDGET (label)->allocation.height);
+       gtk_widget_queue_clear (GTK_WIDGET (label));
       
       gtk_widget_queue_resize (GTK_WIDGET (label));
     }
@@ -281,12 +265,8 @@ gtk_label_set_justify (GtkLabel           *label,
       if (GTK_WIDGET_VISIBLE (label))
        {
          if (GTK_WIDGET_MAPPED (label))
-           gdk_window_clear_area (GTK_WIDGET (label)->window,
-                                  GTK_WIDGET (label)->allocation.x,
-                                  GTK_WIDGET (label)->allocation.y,
-                                  GTK_WIDGET (label)->allocation.width,
-                                  GTK_WIDGET (label)->allocation.height);
-         
+           gtk_widget_queue_clear (GTK_WIDGET (label));
+
          gtk_widget_queue_resize (GTK_WIDGET (label));
        }
     }
@@ -322,10 +302,11 @@ gtk_label_finalize (GtkObject *object)
 }
 
 static gint
-gtk_label_process_row (GtkLabel    *label,
-                      GtkLabelRow *row,
-                      gint         x, gint y,
-                      gboolean     draw)
+gtk_label_process_row (GtkLabel     *label,
+                      GtkLabelRow  *row,
+                      gint          x, gint y,
+                      gboolean      draw,
+                      GdkRectangle *area)
 {
   GtkWidget *widget = GTK_WIDGET (label);
   
@@ -382,16 +363,12 @@ gtk_label_process_row (GtkLabel    *label,
 
              if (draw)
                {
-                 if (widget->state == GTK_STATE_INSENSITIVE)
-                   gdk_draw_line (widget->window,
-                                  widget->style->white_gc,
-                                  offset + x + lbearing, y + descent + 2, 
-                                  offset + x + rbearing + 1, y + descent + 2);
-             
-                 gdk_draw_line (widget->window,
-                                widget->style->fg_gc[widget->state],
-                                offset + x + lbearing - 1, y + descent + 1, 
-                                offset + x + rbearing, y + descent + 1);
+                 gtk_paint_hline (widget->style, widget->window, 
+                                  widget->state, area,
+                                  widget, "label", 
+                                  offset + x + lbearing - 1, 
+                                  offset + x + rbearing, 
+                                  y + descent + 2);
                }
 
              height = MAX (height, 
@@ -406,16 +383,12 @@ gtk_label_process_row (GtkLabel    *label,
 
          if (draw)
            {
-             if (widget->state == GTK_STATE_INSENSITIVE)
-               gdk_draw_text (widget->window, widget->style->font,
-                              widget->style->white_gc,
-                              offset + x + 1, y + 1,
-                              &label->label[row->index+j], i - j);
-             
-             gdk_draw_text (widget->window, widget->style->font,
-                            widget->style->fg_gc[widget->state],
-                            offset + x, y, 
-                            &label->label[row->index+j], i - j);
+             char save = label->label[row->index + i];
+             label->label[row->index + i] = '\0';
+             gtk_paint_string(widget->style, widget->window, widget->state,
+                              area, widget, "label", offset + x, y, 
+                              &label->label[row->index+j]);
+             label->label[row->index + i] = save;
            }
 
                  
@@ -459,7 +432,7 @@ gtk_label_size_request (GtkWidget      *widget,
                                   row->len);
       width = MAX (width, row->width);
 
-      requisition->height += gtk_label_process_row (label, row, 0, 0, FALSE) + 2;
+      requisition->height += gtk_label_process_row (label, row, 0, 0, FALSE, NULL) + 2;
 
       tmp_list = tmp_list->next;
     }
@@ -491,24 +464,7 @@ gtk_label_expose (GtkWidget         *widget,
        */
       gdk_gc_set_clip_rectangle (widget->style->white_gc, &event->area);
       gdk_gc_set_clip_rectangle (widget->style->fg_gc[widget->state], &event->area);
-      
-      /* We clear the whole allocation here so that if a partial
-       * expose is triggered we don't just clear part and mess up
-       * when the queued redraw comes along. (There will always
-       * be a complete queued redraw when the needs_clear flag
-       * is set.)
-       */
-      if (label->needs_clear)
-       {
-         gdk_window_clear_area (widget->window,
-                                widget->allocation.x,
-                                widget->allocation.y,
-                                widget->allocation.width,
-                                widget->allocation.height);
-         
-         label->needs_clear = FALSE;
-       }
-      
+
       x = widget->allocation.x + misc->xpad +
        (widget->allocation.width - (label->max_width + label->misc.xpad * 2))
        * misc->xalign + 0.5;
@@ -517,7 +473,7 @@ gtk_label_expose (GtkWidget  *widget,
           (widget->allocation.y + widget->allocation.height -
            (widget->requisition.height - misc->ypad * 2)) *
           misc->yalign + widget->style->font->ascent) + 1.5;
-      
+
       /* 
        * COMMENT: we can avoid gdk_text_width() calls here storing in label->row
        * the widths of the rows calculated in gtk_label_set.
@@ -527,13 +483,12 @@ gtk_label_expose (GtkWidget        *widget,
       tmp_list = label->row;
       while (tmp_list)
        {
-         y += gtk_label_process_row (label, tmp_list->data, x, y, TRUE) + 2;
+         y += gtk_label_process_row (label, tmp_list->data, x, y, TRUE, &event->area) + 2;
          tmp_list = tmp_list->next;
        }
       
       gdk_gc_set_clip_mask (widget->style->white_gc, NULL);
       gdk_gc_set_clip_mask (widget->style->fg_gc[widget->state], NULL);
-      
     }
   return TRUE;
 }
@@ -553,22 +508,6 @@ gtk_label_free_rows (GtkLabel *label)
   label->row = NULL;
 }
 
-static void 
-gtk_label_state_changed (GtkWidget     *widget,
-                        guint           previous_state)
-{
-  if (GTK_WIDGET_DRAWABLE (widget))
-    GTK_LABEL (widget)->needs_clear = TRUE;
-}
-
-static void 
-gtk_label_style_set (GtkWidget *widget,
-                    GtkStyle   *previous_style)
-{
-  if (GTK_WIDGET_DRAWABLE (widget))
-    GTK_LABEL (widget)->needs_clear = TRUE;
-}
-
 guint      
 gtk_label_parse_uline (GtkLabel         *label,
                       const gchar      *string)
@@ -631,5 +570,3 @@ gtk_label_parse_uline (GtkLabel         *label,
 
   return accel_key;
 }
-
-
index eb419625cdce5648f660625a95629b544e5d39df..0e1ef61759976658640e3d5975a39a15eba9e53e 100644 (file)
@@ -48,7 +48,6 @@ struct _GtkLabel
   GSList *row;
   guint          max_width : 16;
   guint   jtype : 2;
-  guint          needs_clear : 1;
 };
 
 struct _GtkLabelClass
index bab73bd2c38c629a9701e7782f4e598194528cd8..b5837798265744a991424118198b52a53ee36c00 100644 (file)
@@ -380,8 +380,6 @@ gtk_list_item_realize (GtkWidget *widget)
   gdk_window_set_user_data (widget->window, widget);
 
   widget->style = gtk_style_attach (widget->style, widget->window);
-  gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
-
   gdk_window_set_background (widget->window, 
                             &widget->style->base[GTK_STATE_NORMAL]);
 }
@@ -457,60 +455,47 @@ gtk_list_item_draw (GtkWidget    *widget,
     {
       bin = GTK_BIN (widget);
 
-      if (!GTK_WIDGET_IS_SENSITIVE (widget))
-       gtk_style_set_background (widget->style, widget->window, GTK_STATE_INSENSITIVE);
-      else if (widget->state == GTK_STATE_NORMAL)
-       gdk_window_set_background (widget->window, 
-                                  &widget->style->base[GTK_STATE_NORMAL]);
+      if (widget->state == GTK_STATE_NORMAL)
+       {
+         gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
+         gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height);
+       }
       else
-       gtk_style_set_background (widget->style, widget->window, widget->state);
-
-      gdk_window_clear_area (widget->window, area->x, area->y,
-                            area->width, area->height);
+       {
+         gtk_paint_flat_box(widget->style, widget->window, 
+                            widget->state, GTK_SHADOW_ETCHED_OUT,
+                            area, widget, "listitem",
+                            0, 0, -1, -1);           
+       }
 
       if (bin->child && gtk_widget_intersect (bin->child, area, &child_area))
        gtk_widget_draw (bin->child, &child_area);
 
-      gtk_widget_draw_focus (widget);
+      if (GTK_WIDGET_HAS_FOCUS (widget))
+       {
+         if (GTK_IS_LIST (widget->parent) && GTK_LIST (widget->parent)->add_mode)
+           gtk_paint_focus (widget->style, widget->window,
+                            NULL, widget, "add-mode",
+                            0, 0,
+                            widget->allocation.width - 1,
+                            widget->allocation.height - 1);
+         else
+           gtk_paint_focus (widget->style, widget->window,
+                            NULL, widget, NULL,
+                            0, 0,
+                            widget->allocation.width - 1,
+                            widget->allocation.height - 1);
+       }
     }
 }
 
 static void
 gtk_list_item_draw_focus (GtkWidget *widget)
 {
-  GdkGC *gc;
-
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_LIST_ITEM (widget));
-
-  if (GTK_WIDGET_DRAWABLE (widget))
-    {
-      if (GTK_WIDGET_HAS_FOCUS (widget))
-       gc = widget->style->black_gc;
-      else if (!GTK_WIDGET_IS_SENSITIVE (widget))
-       gc = widget->style->bg_gc[GTK_STATE_INSENSITIVE];
-      else if (widget->state == GTK_STATE_NORMAL)
-       gc = widget->style->base_gc[GTK_STATE_NORMAL];
-      else
-       gc = widget->style->bg_gc[widget->state];
-
-      if (GTK_IS_LIST (widget->parent) && GTK_LIST (widget->parent)->add_mode)
-       {
-         gdk_gc_set_line_attributes (gc, 1, GDK_LINE_ON_OFF_DASH, 0, 0);
-         gdk_gc_set_dashes (gc, 0, "\4\4", 2);
-
-         gdk_draw_rectangle (widget->window, gc, FALSE, 0, 0,
-                             widget->allocation.width - 1,
-                             widget->allocation.height - 1);
-         
-         gdk_gc_set_line_attributes (gc, 1, GDK_LINE_SOLID, 0, 0);
-       }
-      else
-       gdk_draw_rectangle (widget->window, gc, FALSE, 0, 0,
-                           widget->allocation.width - 1,
-                           widget->allocation.height - 1);
-
-    }
+  
+  gtk_widget_draw(widget, NULL);
 }
 
 static gint
index f1462b9f2c834bcbf8730bbc87309e55f07cf2df..663c7c7405e904f79e0304646c2cb9a19f31dbe9 100644 (file)
@@ -668,6 +668,7 @@ gtk_menu_realize (GtkWidget *widget)
   
   widget->style = gtk_style_attach (widget->style, widget->window);
   gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
+  gtk_menu_paint(widget);
 }
 
 static void
@@ -788,13 +789,12 @@ gtk_menu_paint (GtkWidget *widget)
   
   if (GTK_WIDGET_DRAWABLE (widget))
     {
-      gtk_draw_shadow (widget->style,
-                      widget->window,
-                      GTK_STATE_NORMAL,
-                      GTK_SHADOW_OUT,
-                      0, 0,
-                      widget->allocation.width,
-                      widget->allocation.height);
+      gtk_paint_box (widget->style,
+                    widget->window,
+                    GTK_STATE_NORMAL,
+                    GTK_SHADOW_OUT,
+                    NULL, widget, "menu",
+                    0, 0, -1, -1);
     }
 }
 
@@ -1086,3 +1086,4 @@ gtk_menu_hide_all (GtkWidget *widget)
   /* Hide children, but not self. */
   gtk_container_foreach (GTK_CONTAINER (widget), (GtkCallback) gtk_widget_hide_all, NULL);
 }
+
index 3f04e5193b02bd0af58ecf8a0d90ecb25e13fa6a..50bb4eecc1e4eaccc844d0eb4d7710db57413947 100644 (file)
@@ -33,7 +33,8 @@ static void gtk_menu_bar_size_request  (GtkWidget       *widget,
                                        GtkRequisition  *requisition);
 static void gtk_menu_bar_size_allocate (GtkWidget       *widget,
                                        GtkAllocation   *allocation);
-static void gtk_menu_bar_paint         (GtkWidget       *widget);
+static void gtk_menu_bar_paint         (GtkWidget       *widget,
+                                       GdkRectangle    *area);
 static void gtk_menu_bar_draw          (GtkWidget       *widget,
                                        GdkRectangle    *area);
 static gint gtk_menu_bar_expose        (GtkWidget       *widget,
@@ -262,20 +263,20 @@ gtk_menu_bar_size_allocate (GtkWidget     *widget,
 }
 
 static void
-gtk_menu_bar_paint (GtkWidget *widget)
+gtk_menu_bar_paint (GtkWidget *widget, GdkRectangle *area)
 {
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_MENU_BAR (widget));
 
   if (GTK_WIDGET_DRAWABLE (widget))
     {
-      gtk_draw_shadow (widget->style,
-                      widget->window,
-                      GTK_STATE_NORMAL,
-                      GTK_SHADOW_OUT,
-                      0, 0,
-                      widget->allocation.width,
-                      widget->allocation.height);
+      gtk_paint_box (widget->style,
+                    widget->window,
+                    GTK_STATE_NORMAL,
+                    GTK_SHADOW_OUT,
+                    area, widget, "menubar",
+                    0, 0,
+                    -1,-1);
     }
 }
 
@@ -294,7 +295,7 @@ gtk_menu_bar_draw (GtkWidget    *widget,
 
   if (GTK_WIDGET_DRAWABLE (widget))
     {
-      gtk_menu_bar_paint (widget);
+      gtk_menu_bar_paint (widget, area);
 
       menu_shell = GTK_MENU_SHELL (widget);
 
@@ -315,9 +316,9 @@ gtk_menu_bar_expose (GtkWidget      *widget,
                     GdkEventExpose *event)
 {
   GtkMenuShell *menu_shell;
-  GtkWidget *child;
   GdkEventExpose child_event;
   GList *children;
+  GtkWidget *child;
 
   g_return_val_if_fail (widget != NULL, FALSE);
   g_return_val_if_fail (GTK_IS_MENU_BAR (widget), FALSE);
@@ -325,7 +326,7 @@ gtk_menu_bar_expose (GtkWidget      *widget,
 
   if (GTK_WIDGET_DRAWABLE (widget))
     {
-      gtk_menu_bar_paint (widget);
+      gtk_menu_bar_paint (widget, &event->area);
 
       menu_shell = GTK_MENU_SHELL (widget);
       child_event = *event;
index 59abb8bfeaa15c2c2b1dff4909fad9482acd9543..8890a7502b0238413e485a2e1f79a16265c46dd3 100644 (file)
@@ -415,21 +415,24 @@ gtk_menu_item_paint (GtkWidget    *widget,
       if (!GTK_WIDGET_IS_SENSITIVE (widget))
        state_type = GTK_STATE_INSENSITIVE;
 
-      gtk_style_set_background (widget->style, widget->window, state_type);
-      gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height);
-
       x = GTK_CONTAINER (menu_item)->border_width;
       y = GTK_CONTAINER (menu_item)->border_width;
       width = widget->allocation.width - x * 2;
       height = widget->allocation.height - y * 2;
-
+      
       if ((state_type == GTK_STATE_PRELIGHT) &&
          (GTK_BIN (menu_item)->child))
-       gtk_draw_shadow (widget->style,
-                        widget->window,
-                        GTK_STATE_PRELIGHT,
-                        GTK_SHADOW_OUT,
-                        x, y, width, height);
+       gtk_paint_box (widget->style,
+                      widget->window,
+                      GTK_STATE_PRELIGHT,
+                      GTK_SHADOW_OUT,
+                      area, widget, "menuitem",
+                      x, y, width, height);
+      else
+       {
+         gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
+         gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height);
+       }
 
       if (menu_item->submenu && menu_item->show_submenu_indicator)
        {
@@ -437,14 +440,17 @@ gtk_menu_item_paint (GtkWidget    *widget,
          if (state_type == GTK_STATE_PRELIGHT)
            shadow_type = GTK_SHADOW_IN;
 
-         gtk_draw_arrow (widget->style, widget->window,
-                         state_type, shadow_type, GTK_ARROW_RIGHT, FALSE,
-                         x + width - 15, y + height / 2 - 5, 10, 10);
+         gtk_paint_arrow (widget->style, widget->window,
+                          state_type, shadow_type, 
+                          area, widget, "menuitem", 
+                          GTK_ARROW_RIGHT, TRUE,
+                          x + width - 15, y + height / 2 - 5, 10, 10);
        }
       else if (!GTK_BIN (menu_item)->child)
        {
-         gtk_draw_hline (widget->style, widget->window, GTK_STATE_NORMAL,
-                         0, widget->allocation.width, 0);
+          gtk_paint_hline (widget->style, widget->window, GTK_STATE_NORMAL,
+                           area, widget, "menuitem",
+                           0, widget->allocation.width, 0);
        }
     }
 }
index 0445cf854eb2a2e6ed91f3ce0aa0a13950ed0bf7..e2fdf50f13bd69cae137318ead08ff14a18f3e96 100644 (file)
@@ -182,12 +182,7 @@ gtk_misc_set_alignment (GtkMisc *misc,
           GtkWidget *widget;
          
           widget = GTK_WIDGET (misc);
-          gdk_window_clear_area (widget->window,
-                                 widget->allocation.x,
-                                 widget->allocation.y,
-                                 widget->allocation.width,
-                                 widget->allocation.height);
-         gtk_widget_queue_draw (GTK_WIDGET (misc));
+          gtk_widget_queue_clear (widget);
         }
     }
 }
index 71b69cd7e659e420be950f2835cd888274e70bbf..e10724624a4a99fd10a894318876a22c1c8d2573 100644 (file)
@@ -28,8 +28,8 @@
 
 #define TAB_OVERLAP    2
 #define TAB_CURVATURE  1
-#define ARROW_SIZE     11
-#define ARROW_SPACING  3
+#define ARROW_SIZE     12
+#define ARROW_SPACING  0
 #define NOTEBOOK_INIT_SCROLL_DELAY (200)
 #define NOTEBOOK_SCROLL_DELAY      (100)
 
@@ -168,7 +168,9 @@ static void gtk_notebook_menu_item_create    (GtkNotebook      *notebook,
 static GtkType gtk_notebook_child_type       (GtkContainer     *container);
 static gint    gtk_notebook_find_page        (gconstpointer     a,
                                              gconstpointer     b);
-
+static void gtk_notebook_set_shape           (GtkNotebook      *notebook);
+static void gtk_notebook_style_set           (GtkWidget        *widget,
+                                             GtkStyle         *previous_style);
 
 static GtkContainerClass *parent_class = NULL;
 static guint notebook_signals[LAST_SIGNAL] = { 0 };
@@ -254,7 +256,8 @@ gtk_notebook_class_init (GtkNotebookClass *class)
   widget_class->focus_in_event = gtk_notebook_focus_in;
   widget_class->focus_out_event = gtk_notebook_focus_out;
   widget_class->draw_focus = gtk_notebook_draw_focus;
-
+  widget_class->style_set = gtk_notebook_style_set;
+   
   container_class->add = gtk_notebook_add;
   container_class->remove = gtk_notebook_remove;
   container_class->forall = gtk_notebook_forall;
@@ -643,7 +646,7 @@ gtk_notebook_insert_page_menu (GtkNotebook *notebook,
   page->allocation.height = 0;
   page->default_menu = FALSE;
   page->default_tab = FALSE;
-
+   
   nchildren = g_list_length (notebook->children);
   if ((position < 0) || (position > nchildren))
     position = nchildren;
@@ -1182,11 +1185,7 @@ gtk_notebook_set_tab_pos (GtkNotebook     *notebook,
       notebook->tab_pos = pos;
 
       if (GTK_WIDGET_VISIBLE (notebook))
-       {
-         gtk_widget_queue_resize (GTK_WIDGET (notebook));
-         if (notebook->panel)
-           gdk_window_clear (notebook->panel);
-       }
+       gtk_widget_queue_resize (GTK_WIDGET (notebook));
     }
 }
 
@@ -1275,17 +1274,28 @@ gtk_notebook_set_scrollable (GtkNotebook     *notebook,
   g_return_if_fail (notebook != NULL);
   g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
 
+  scrollable = (scrollable != FALSE);
+
   if (scrollable != notebook->scrollable)
     {
-      if ( (notebook->scrollable = (scrollable != 0)) ) 
-       gtk_notebook_panel_realize (notebook);
-      else if (notebook->panel)
+      notebook->scrollable = scrollable;
+
+      if (GTK_WIDGET_REALIZED (notebook))
        {
-         gdk_window_destroy (notebook->panel);
-         notebook->panel = NULL;
+         if (scrollable)
+           {
+             gtk_notebook_panel_realize (notebook);
+           }
+         else if (notebook->panel)
+           {
+             gdk_window_destroy (notebook->panel);
+             notebook->panel = NULL;
+           }
        }
-      gtk_widget_queue_resize (GTK_WIDGET(notebook));
-    }    
+
+      if (GTK_WIDGET_VISIBLE (notebook))
+       gtk_widget_queue_resize (GTK_WIDGET(notebook));
+    }
 }
 
 static void
@@ -1361,8 +1371,8 @@ gtk_notebook_realize (GtkWidget *widget)
   attributes.visual = gtk_widget_get_visual (widget);
   attributes.colormap = gtk_widget_get_colormap (widget);
   attributes.event_mask = gtk_widget_get_events (widget);
-  attributes.event_mask |= GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK
-    | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK;
+  attributes.event_mask |= GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK |
+                           GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK;
 
   attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
 
@@ -1372,6 +1382,7 @@ gtk_notebook_realize (GtkWidget *widget)
   widget->style = gtk_style_attach (widget->style, widget->window);
   gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
 
+  gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
   if (notebook->scrollable)
     gtk_notebook_panel_realize (notebook);
 }
@@ -1417,6 +1428,7 @@ gtk_notebook_panel_realize (GtkNotebook *notebook)
                                    attributes_mask);
   gtk_style_set_background (widget->style, notebook->panel, 
                            GTK_STATE_NORMAL);
+  gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
   gdk_window_set_user_data (notebook->panel, widget);
 }
 
@@ -1636,6 +1648,7 @@ gtk_notebook_size_allocate (GtkWidget     *widget,
 
       gtk_notebook_pages_allocate (notebook, allocation);
     }
+   gtk_notebook_set_shape (notebook);
 }
 
 static void
@@ -1645,11 +1658,11 @@ gtk_notebook_paint (GtkWidget    *widget,
   GtkNotebook *notebook;
   GtkNotebookPage *page;
   GList *children;
-  GdkPoint points[6];
   gint width, height;
   gint x, y;
   gint showarrow;
-
+  gint gap_x = 0, gap_width = 0;
+   
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_NOTEBOOK (widget));
   g_return_if_fail (area != NULL);
@@ -1658,10 +1671,6 @@ gtk_notebook_paint (GtkWidget    *widget,
     {
       notebook = GTK_NOTEBOOK (widget);
 
-      gdk_window_clear_area (widget->window,
-                            area->x, area->y,
-                            area->width, area->height);
-
       if (notebook->show_tabs || notebook->show_border)
        {
          x = GTK_CONTAINER (widget)->border_width;
@@ -1693,16 +1702,15 @@ gtk_notebook_paint (GtkWidget    *widget,
                    case GTK_POS_RIGHT:
                      width -= page->allocation.width +
                        widget->style->klass->xthickness;
-                   break;
+                     break;
                    }
-                 gtk_draw_shadow (widget->style, widget->window,
-                                  GTK_STATE_NORMAL, GTK_SHADOW_OUT,
-                                  x, y, width, height);
+                 gtk_paint_box (widget->style, widget->window,
+                                GTK_STATE_NORMAL, GTK_SHADOW_OUT,
+                                area, widget, "notebook",
+                                x, y, width, height);
                }
              else
                {
-                 gint i = 0;
-
                  switch (notebook->tab_pos)
                    {
                    case GTK_POS_TOP:
@@ -1716,141 +1724,35 @@ gtk_notebook_paint (GtkWidget    *widget,
                      width -= notebook->cur_page->allocation.width;
                      break;
                    }
-                 
-                 switch (notebook->tab_pos)
+
+                  switch (notebook->tab_pos)
                    {
                    case GTK_POS_TOP:
-                     if (x != notebook->cur_page->allocation.x)
-                       {
-                         points[i].x = notebook->cur_page->allocation.x;
-                         points[i++].y = y;
-                       }
-
-                     points[i].x = x;
-                     points[i++].y = y;
-                     points[i].x = x;
-                     points[i++].y = y + height - 1;
-                     points[i].x = x + width - 1;
-                     points[i++].y = y + height - 1;
-                     points[i].x = x + width - 1;
-                     points[i++].y = y;
-
-                     if ((notebook->cur_page->allocation.x +
-                          notebook->cur_page->allocation.width -
-                          widget->style->klass->xthickness) <
-                         x + width - widget->style->klass->xthickness)
-                       {
-                         points[i].x = (notebook->cur_page->allocation.x +
-                                        notebook->cur_page->allocation.width -
-                                        widget->style->klass->xthickness);
-
-                         if (points[i].x == (x + width))
-                           points[i].x -= 1;
-
-                         points[i++].y = y;
-                       }
+                     gap_x = notebook->cur_page->allocation.x -
+                       GTK_CONTAINER(notebook)->border_width;
+                     gap_width = notebook->cur_page->allocation.width;
                      break;
-
                    case GTK_POS_BOTTOM:
-                     if ((notebook->cur_page->allocation.x +
-                          notebook->cur_page->allocation.width -
-                          widget->style->klass->xthickness) <
-                         x + width - widget->style->klass->xthickness)
-                       {
-                         points[i].x = (notebook->cur_page->allocation.x +
-                                        notebook->cur_page->allocation.width -
-                                        widget->style->klass->xthickness);
-
-                         if (points[i].x == (x + width))
-                           points[i].x -= 1;
-
-                         points[i++].y = y + height - 1;
-                       }
-
-                     points[i].x = x + width - 1;
-                     points[i++].y = y + height - 1;
-                     points[i].x = x + width - 1;
-                     points[i++].y = y;
-                     points[i].x = x;
-                     points[i++].y = y;
-                     points[i].x = x;
-                     points[i++].y = y + height - 1;
-                     
-                     if (notebook->cur_page->allocation.x != x)
-                       {
-                         points[i].x = notebook->cur_page->allocation.x;
-                         points[i++].y = y + height - 1;
-                       }
+                     gap_x = notebook->cur_page->allocation.x -
+                       GTK_CONTAINER(notebook)->border_width;
+                     gap_width = notebook->cur_page->allocation.width;
                      break;
-
                    case GTK_POS_LEFT:
-                     if ((notebook->cur_page->allocation.y +
-                          notebook->cur_page->allocation.height -
-                          widget->style->klass->ythickness) <
-                         y + height - widget->style->klass->ythickness)
-                       {
-                         points[i].x = x;
-                         points[i++].y = notebook->cur_page->allocation.y +
-                           notebook->cur_page->allocation.height -
-                           widget->style->klass->ythickness;
-
-                         if (points[0].y == (y + height))
-                           points[0].y -= 1;
-                       }
-                 
-                     points[i].x = x;
-                     points[i++].y = y + height - 1;
-                     points[i].x = x + width - 1;
-                     points[i++].y = y + height - 1;
-                     points[i].x = x + width - 1;
-                     points[i++].y = y;
-                     points[i].x = x;
-                     points[i++].y = y;
-
-                     if (notebook->cur_page->allocation.y != y)
-                       {
-                         points[i].x = x;
-                         points[i++].y = notebook->cur_page->allocation.y;
-                       }
+                     gap_x = notebook->cur_page->allocation.y -
+                       GTK_CONTAINER(notebook)->border_width;
+                     gap_width = notebook->cur_page->allocation.height;
                      break;
-
                    case GTK_POS_RIGHT:
-                     if (notebook->cur_page->allocation.y != y)
-                       {
-                         points[i].x = x + width - 1;
-                         points[i++].y = notebook->cur_page->allocation.y;
-                       }
-
-                     points[i].x = x + width - 1;
-                     points[i++].y = y;
-                     points[i].x = x;
-                     points[i++].y = y;
-                     points[i].x = x;
-                     points[i++].y = y + height - 1;
-                     points[i].x = x + width - 1;
-                     points[i++].y = y + height - 1;
-
-                     if ((notebook->cur_page->allocation.y +
-                          notebook->cur_page->allocation.height -
-                          widget->style->klass->ythickness) <
-                         y + height - widget->style->klass->ythickness)
-                       {
-                         points[i].x = x + width - 1;
-                         points[i++].y = notebook->cur_page->allocation.y +
-                           notebook->cur_page->allocation.height -
-                           widget->style->klass->ythickness;
-
-                         if (points[i - 1].y == (y + height))
-                           points[i - 1].y -= 1;
-                       }
+                     gap_x = notebook->cur_page->allocation.y -
+                       GTK_CONTAINER(notebook)->border_width;
+                     gap_width = notebook->cur_page->allocation.height;
                      break;
-
                    }
-
-                   gtk_draw_polygon (widget->style, widget->window,
-                                     GTK_STATE_NORMAL, GTK_SHADOW_OUT,
-                                     points, i, FALSE);
-
+                 gtk_paint_box_gap(widget->style, widget->window,
+                                   GTK_STATE_NORMAL, GTK_SHADOW_OUT,
+                                   area, widget, "notebook",
+                                   x, y, width, height,
+                                   notebook->tab_pos, gap_x, gap_width);
                }
              children = g_list_last (notebook->children);
              showarrow = FALSE;
@@ -1878,9 +1780,10 @@ gtk_notebook_paint (GtkWidget    *widget,
            }
          else if (notebook->show_border)
            {
-             gtk_draw_shadow (widget->style, widget->window,
-                              GTK_STATE_NORMAL, GTK_SHADOW_OUT,
-                              x, y, width, height);
+             gtk_paint_box(widget->style, widget->window,
+                           GTK_STATE_NORMAL, GTK_SHADOW_OUT,
+                           area, widget, "notebook",
+                           x, y, width, height);
            }
        }
     }
@@ -1916,7 +1819,8 @@ gtk_notebook_expose (GtkWidget      *widget,
 {
   GtkNotebook *notebook;
   GdkEventExpose child_event;
-
+  GdkRectangle child_area;
+   
   g_return_val_if_fail (widget != NULL, FALSE);
   g_return_val_if_fail (GTK_IS_NOTEBOOK (widget), FALSE);
   g_return_val_if_fail (event != NULL, FALSE);
@@ -1926,7 +1830,10 @@ gtk_notebook_expose (GtkWidget      *widget,
       notebook = GTK_NOTEBOOK (widget);
 
       gtk_notebook_paint (widget, &event->area);
-      gtk_widget_draw_focus (widget);
+      if (notebook->cur_page &&
+         gtk_widget_intersect (notebook->cur_page->tab_label, 
+                                &event->area, &child_area))
+        gtk_widget_draw_focus (widget);
 
       child_event = *event;
       if (notebook->cur_page && 
@@ -2059,6 +1966,7 @@ gtk_notebook_button_press (GtkWidget      *widget,
       if (!children && !GTK_WIDGET_HAS_FOCUS (widget))
        gtk_widget_grab_focus (widget);
     }
+   gtk_notebook_set_shape (notebook);
   return FALSE;
 }
 
@@ -2277,9 +2185,12 @@ gtk_notebook_draw_arrow (GtkNotebook *notebook, guint arrow)
          if (notebook->tab_pos == GTK_POS_LEFT ||
              notebook->tab_pos == GTK_POS_RIGHT)
            arrow = GTK_ARROW_UP;
-         gtk_draw_arrow (widget->style, notebook->panel, state_type, 
-                         shadow_type, arrow, TRUE, 
-                          0, 0, ARROW_SIZE, ARROW_SIZE);
+
+         gdk_window_clear_area (notebook->panel, 0, 0, ARROW_SIZE, ARROW_SIZE);
+         gtk_paint_arrow (widget->style, notebook->panel, state_type, 
+                          shadow_type, NULL, GTK_WIDGET(notebook), "notebook",
+                          arrow, TRUE, 
+                          0, 0, ARROW_SIZE, ARROW_SIZE);
        }
       else
        {
@@ -2292,9 +2203,12 @@ gtk_notebook_draw_arrow (GtkNotebook *notebook, guint arrow)
          if (notebook->tab_pos == GTK_POS_LEFT ||
              notebook->tab_pos == GTK_POS_RIGHT)
            arrow = GTK_ARROW_DOWN;
-         gtk_draw_arrow (widget->style, notebook->panel, state_type, 
-                         shadow_type, arrow, TRUE, ARROW_SIZE + ARROW_SPACING,
-                          0, ARROW_SIZE, ARROW_SIZE);
+          gdk_window_clear_area(notebook->panel, ARROW_SIZE + ARROW_SPACING, 
+                                0, ARROW_SIZE, ARROW_SIZE);
+          gtk_paint_arrow (widget->style, notebook->panel, state_type, 
+                           shadow_type, NULL, GTK_WIDGET(notebook), "notebook",
+                           arrow, TRUE, ARROW_SIZE + ARROW_SPACING,
+                           0, ARROW_SIZE, ARROW_SIZE);
        }
     }
 }
@@ -2322,7 +2236,6 @@ gtk_notebook_real_switch_page (GtkNotebook     *notebook,
       g_list_find (notebook->children, notebook->cur_page);
 
   gtk_notebook_pages_allocate (notebook, &GTK_WIDGET (notebook)->allocation);
-  gtk_notebook_expose_tabs (notebook);
   
   if (GTK_WIDGET_MAPPED (notebook))
     {
@@ -2338,6 +2251,7 @@ gtk_notebook_real_switch_page (GtkNotebook     *notebook,
   
   if (GTK_WIDGET_DRAWABLE (notebook))
     gtk_widget_queue_draw (GTK_WIDGET (notebook));
+   gtk_notebook_set_shape (notebook);
 }
 
 static void
@@ -2348,14 +2262,14 @@ gtk_notebook_draw_tab (GtkNotebook     *notebook,
   GdkRectangle child_area;
   GdkRectangle page_area;
   GtkStateType state_type;
-  GdkPoint points[6];
-  gint n = 0;
+  GtkPositionType gap_side;
+  
   g_return_if_fail (notebook != NULL);
   g_return_if_fail (page != NULL);
   g_return_if_fail (area != NULL);
 
-  if (!GTK_WIDGET_MAPPED (page->tab_label))
+  if (!GTK_WIDGET_MAPPED (page->tab_label) ||
+      (page->allocation.width == 0) || (page->allocation.height == 0))
     return;
 
   page_area.x = page->allocation.x;
@@ -2367,207 +2281,45 @@ gtk_notebook_draw_tab (GtkNotebook     *notebook,
     {
       GtkWidget *widget;
 
+      widget = GTK_WIDGET (notebook);
+      gap_side = 0;
       switch (notebook->tab_pos)
        {
        case GTK_POS_TOP:
-         if (child_area.x + child_area.width > 
-             page->allocation.x + page->allocation.width - TAB_OVERLAP) 
-           {
-             points[0].x = page->allocation.x + page->allocation.width - 1;
-             points[0].y = page->allocation.y + page->allocation.height - 1;
-
-             points[1].x = page->allocation.x + page->allocation.width - 1;
-             points[1].y = page->allocation.y + TAB_CURVATURE;
-
-             points[2].x = page->allocation.x + page->allocation.width 
-               - TAB_CURVATURE - 1;
-             points[2].y = page->allocation.y;
-             n = 3;
-           }
-         else 
-           {
-             points[0].x = page->allocation.x + page->allocation.width 
-               - TAB_OVERLAP - 1;
-             points[0].y = page->allocation.y;
-             n = 1;
-           }
-         
-         if ( (child_area.x < page->allocation.x + TAB_OVERLAP) &&
-              (page == notebook->cur_page || 
-               page == (GtkNotebookPage *)(notebook->children->data) ||
-               (notebook->scrollable && 
-                page == (GtkNotebookPage *)(notebook->first_tab->data))) ) 
-           {
-             points[n].x = page->allocation.x + TAB_CURVATURE;
-             points[n++].y = page->allocation.y;
-           
-             points[n].x = page->allocation.x;
-             points[n++].y = page->allocation.y + TAB_CURVATURE;
-
-             points[n].x = page->allocation.x;
-             points[n++].y = page->allocation.y + page->allocation.height - 1;
-           }
-         else 
-           {
-             points[n].x = page->allocation.x + TAB_OVERLAP;
-             points[n++].y = page->allocation.y;
-           }
+         gap_side = GTK_POS_BOTTOM;
          break;
        case GTK_POS_BOTTOM:
-         if ( (child_area.x < page->allocation.x + TAB_OVERLAP) &&
-              (page == notebook->cur_page || 
-               page == (GtkNotebookPage *)(notebook->children->data) ||
-               (notebook->scrollable && 
-                page == (GtkNotebookPage *)(notebook->first_tab->data))) ) 
-           {
-             points[0].x = page->allocation.x;
-             points[0].y = page->allocation.y;
-
-             points[1].x = page->allocation.x;
-             points[1].y = page->allocation.y + page->allocation.height 
-               - TAB_CURVATURE - 1;
-
-             points[2].x = page->allocation.x + TAB_CURVATURE;
-             points[2].y = page->allocation.y + page->allocation.height - 1;
-             n = 3;
-           }
-         else 
-           {
-             points[0].x = page->allocation.x + TAB_OVERLAP;
-             points[0].y = page->allocation.y + page->allocation.height - 1;
-             n = 1;
-           }
-
-         if (child_area.x + child_area.width > 
-             page->allocation.x + page->allocation.width - TAB_OVERLAP)
-           {
-             points[n].x = page->allocation.x + page->allocation.width 
-               - TAB_CURVATURE - 1;
-             points[n++].y = page->allocation.y + page->allocation.height - 1;
-
-             points[n].x = page->allocation.x + page->allocation.width - 1;
-             points[n++].y = page->allocation.y + page->allocation.height 
-               - TAB_CURVATURE - 1;
-           
-             points[n].x = page->allocation.x + page->allocation.width - 1;
-             points[n++].y = page->allocation.y;
-           }
-         else 
-           {
-             points[n].x = page->allocation.x + page->allocation.width 
-               - TAB_OVERLAP - 1;
-             points[n++].y = page->allocation.y + page->allocation.height - 1;
-           }
+         gap_side = GTK_POS_TOP;
          break;
        case GTK_POS_LEFT:
-         if ( (child_area.y < page->allocation.y + TAB_OVERLAP) &&
-              (page == notebook->cur_page || 
-               page == (GtkNotebookPage *)(notebook->children->data) ||
-               (notebook->scrollable && 
-                page == (GtkNotebookPage *)(notebook->first_tab->data))) )
-           {
-             points[0].x = page->allocation.x + page->allocation.width - 1;
-             points[0].y = page->allocation.y;
-             
-             points[1].x = page->allocation.x + TAB_CURVATURE;
-             points[1].y = page->allocation.y;
-
-             points[2].x = page->allocation.x;
-             points[2].y = page->allocation.y + TAB_CURVATURE;
-             n = 3;
-           }
-         else 
-           {
-             points[0].x = page->allocation.x;
-             points[0].y = page->allocation.y + TAB_OVERLAP;
-             n = 1;
-           }
-
-         if (child_area.y + child_area.height > 
-             page->allocation.y + page->allocation.height - TAB_OVERLAP) 
-           {
-             points[n].x = page->allocation.x;
-             points[n++].y = page->allocation.y + page->allocation.height 
-               - TAB_CURVATURE - 1;
-
-             points[n].x = page->allocation.x + TAB_CURVATURE;
-             points[n++].y = page->allocation.y + page->allocation.height - 1;
-
-             points[n].x = page->allocation.x + page->allocation.width - 1;
-             points[n++].y = page->allocation.y + page->allocation.height - 1;
-           }
-         else 
-           {
-             points[n].x = page->allocation.x;
-             points[n++].y = page->allocation.y + page->allocation.height 
-               - TAB_OVERLAP - 1;
-           }
+         gap_side = GTK_POS_RIGHT;
          break;
        case GTK_POS_RIGHT:
-         if (child_area.y + child_area.height > 
-             page->allocation.y + page->allocation.height - TAB_OVERLAP) 
-           {
-             points[0].x = page->allocation.x;
-             points[0].y = page->allocation.y + page->allocation.height - 1;
-
-             points[1].x = page->allocation.x + page->allocation.width 
-               - TAB_CURVATURE - 1;
-             points[1].y = page->allocation.y + page->allocation.height - 1;
-             
-             points[2].x = page->allocation.x + page->allocation.width - 1;
-             points[2].y = page->allocation.y + page->allocation.height 
-               - TAB_CURVATURE - 1;
-             n = 3;
-           }
-         else 
-           {
-             points[0].x = page->allocation.x + page->allocation.width - 1;
-             points[0].y = page->allocation.y + page->allocation.height 
-               - TAB_OVERLAP - 1;
-             n = 1;
-           }
-
-         if ( (child_area.y < page->allocation.y + TAB_OVERLAP) && 
-              (page == notebook->cur_page || 
-               page == (GtkNotebookPage *)(notebook->children->data) ||
-               (notebook->scrollable && 
-                page == (GtkNotebookPage *)(notebook->first_tab->data))) ) 
-           {
-             points[n].x = page->allocation.x + page->allocation.width - 1;
-             points[n++].y = page->allocation.y + TAB_CURVATURE;
-
-             points[n].x = page->allocation.x + page->allocation.width 
-               - TAB_CURVATURE - 1;
-             points[n++].y = page->allocation.y;
-
-             points[n].x = page->allocation.x;
-             points[n++].y = page->allocation.y;
-           }
-         else 
-           {
-             points[n].x = page->allocation.x + page->allocation.width - 1;
-             points[n++].y = page->allocation.y + TAB_OVERLAP;
-           }
+         gap_side = GTK_POS_RIGHT;
          break;
        }
-
-      widget = GTK_WIDGET(notebook);
-
+      
       if (notebook->cur_page == page)
-       {
-         state_type = GTK_STATE_NORMAL;
-       }
+       state_type = GTK_STATE_NORMAL;
       else 
+       state_type = GTK_STATE_ACTIVE;
+      gtk_paint_extension(widget->style, widget->window,
+                         state_type, GTK_SHADOW_OUT,
+                         area, widget, "tab",
+                         page_area.x, page_area.y,
+                         page_area.width, page_area.height,
+                         gap_side);
+      if ((GTK_WIDGET_HAS_FOCUS (widget)) &&
+         notebook->focus_tab && (notebook->focus_tab->data == page) &&
+         (page))
        {
-         state_type = GTK_STATE_ACTIVE;
-         gdk_draw_rectangle (widget->window, widget->style->bg_gc[state_type],
-                             TRUE, child_area.x, child_area.y,
-                             child_area.width, child_area.height);
+         gtk_paint_focus (widget->style, widget->window,
+                          area, widget, "tab",
+                          page->tab_label->allocation.x - 1,
+                          page->tab_label->allocation.y - 1,
+                          page->tab_label->allocation.width + 1,
+                          page->tab_label->allocation.height + 1);
        }
-      
-      gtk_draw_polygon (widget->style, widget->window, state_type, 
-                       GTK_SHADOW_OUT, points, n, FALSE);
-
       if (gtk_widget_intersect (page->tab_label, area, &child_area))
        gtk_widget_draw (page->tab_label, &child_area);
     }
@@ -2649,77 +2401,27 @@ gtk_notebook_draw_focus (GtkWidget *widget)
   if (GTK_WIDGET_DRAWABLE (widget) && notebook->show_tabs &&
       notebook->focus_tab)
     {
-      GtkNotebookPage *page;
-      GdkGC *gc;
-
-      page = notebook->focus_tab->data;
-
-      if (GTK_WIDGET_HAS_FOCUS (widget))
-        gc = widget->style->black_gc;
-      else if (page == notebook->cur_page)
-        gc = widget->style->bg_gc[GTK_STATE_NORMAL];
-      else
-        gc = widget->style->bg_gc[GTK_STATE_ACTIVE];
-
-      gdk_draw_rectangle (widget->window, 
-                         gc, FALSE, 
-                         page->tab_label->allocation.x - 1, 
-                         page->tab_label->allocation.y - 1,
-                         page->tab_label->allocation.width + 1, 
-                         page->tab_label->allocation.height + 1);
+       GtkNotebookPage *page;
+       GdkRectangle area;
+       
+       page = notebook->focus_tab->data;
+       
+       area.x = widget->allocation.x;
+       area.y = widget->allocation.y;
+       area.width = widget->allocation.width;
+       area.height = widget->allocation.height;
+       
+       gtk_notebook_draw_tab(GTK_NOTEBOOK(widget), page, &area);
     }
 }
 
 static void
 gtk_notebook_focus_changed (GtkNotebook *notebook, GtkNotebookPage *old_page)
 {
-  GtkWidget *widget;
-
   g_return_if_fail (notebook != NULL);
   g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
 
-  widget = GTK_WIDGET (notebook);
-
-  if (GTK_WIDGET_DRAWABLE (widget) && notebook->show_tabs)
-    {
-      GdkGC *gc;
-
-      if (notebook->focus_tab)
-       {
-         GtkNotebookPage *page;
-
-         page = notebook->focus_tab->data;
-
-         if (GTK_WIDGET_HAS_FOCUS (widget))
-           gc = widget->style->black_gc;
-         else if (page == notebook->cur_page)
-           gc = widget->style->bg_gc[GTK_STATE_NORMAL];
-         else
-           gc = widget->style->bg_gc[GTK_STATE_ACTIVE];
-         
-         gdk_draw_rectangle (widget->window, 
-                             gc, FALSE, 
-                             page->tab_label->allocation.x - 1, 
-                             page->tab_label->allocation.y - 1,
-                             page->tab_label->allocation.width + 1, 
-                             page->tab_label->allocation.height + 1);
-       }
-
-      if (old_page)
-       {
-         if (old_page == notebook->cur_page)
-           gc = widget->style->bg_gc[GTK_STATE_NORMAL];
-         else
-           gc = widget->style->bg_gc[GTK_STATE_ACTIVE];
-         
-         gdk_draw_rectangle (widget->window, 
-                             gc, FALSE, 
-                             old_page->tab_label->allocation.x - 1, 
-                             old_page->tab_label->allocation.y - 1,
-                             old_page->tab_label->allocation.width + 1, 
-                             old_page->tab_label->allocation.height + 1);
-       }
-    }
+   gtk_notebook_expose_tabs(notebook);
 }
 
 static void 
@@ -3033,6 +2735,7 @@ gtk_notebook_pages_allocate (GtkNotebook   *notebook,
            gtk_widget_map (page->tab_label);
        }
     }
+  gtk_notebook_set_shape (notebook);
 }
 
 static void
@@ -3338,7 +3041,7 @@ gtk_notebook_switch_focus_tab (GtkNotebook *notebook,
   old_tab = notebook->focus_tab;
   notebook->focus_tab = new_child;
 
-  if (notebook->scrollable)
+  if (notebook->scrollable && GTK_WIDGET_DRAWABLE (notebook))
     {
       if ((new_child == NULL) != (old_tab == NULL))
        {
@@ -3380,6 +3083,8 @@ gtk_notebook_switch_focus_tab (GtkNotebook *notebook,
                                   &(GTK_WIDGET (notebook)->allocation));
       gtk_notebook_expose_tabs (notebook);
     }
+
+   gtk_notebook_set_shape (notebook);
 }
 
 static gint
@@ -3579,3 +3284,136 @@ gtk_notebook_find_page (gconstpointer    a,
 {
   return (((GtkNotebookPage *) a)->child != b);
 }
+
+static void
+gtk_notebook_set_shape (GtkNotebook *notebook)
+{
+   GtkWidget       *widget = NULL;
+   GdkPixmap       *pm = NULL;
+   GdkGC           *pmgc = NULL;
+   GdkColor         col;
+   gint             x, y, width, height, w, h, depth;
+   GtkNotebookPage *page;
+   GList           *children;
+   
+   if (!GTK_WIDGET(notebook)->window)
+     return;
+
+   widget = GTK_WIDGET(notebook);
+   
+   w = widget->allocation.width;
+   h = widget->allocation.height;
+   
+   pm = gdk_pixmap_new (widget->window, w, h, 1);
+   pmgc = gdk_gc_new (pm);
+
+   /* clear the shape mask */
+   col.pixel = 0;
+   gdk_gc_set_foreground(pmgc, &col);
+   gdk_draw_rectangle(pm, pmgc, TRUE, 0, 0, w, h);
+
+   col.pixel = 1;
+   gdk_gc_set_foreground(pmgc, &col);
+
+   /* draw the shape for the notebook page itself */
+   x = GTK_CONTAINER(notebook)->border_width;
+   y = GTK_CONTAINER(notebook)->border_width;
+   width = widget->allocation.width - x * 2;
+   height = widget->allocation.height - y * 2;
+
+   if (notebook->show_tabs && notebook->children)
+     {
+       if (!(notebook->show_tabs))
+         {
+            page = notebook->first_tab->data;
+            switch (notebook->tab_pos)
+              {
+               case GTK_POS_TOP:
+                 y += page->allocation.height +
+                   widget->style->klass->ythickness;
+               case GTK_POS_BOTTOM:
+                 height -= page->allocation.height +
+                   widget->style->klass->ythickness;
+                 break;
+               case GTK_POS_LEFT:
+                 x += page->allocation.width +
+                   widget->style->klass->xthickness;
+               case GTK_POS_RIGHT:
+                 width -= page->allocation.width +
+                   widget->style->klass->xthickness;
+                 break;
+              }
+         }
+       else
+         {
+            page =  notebook->cur_page;
+            if (!GTK_WIDGET_MAPPED (page->tab_label))
+              {
+                 if (notebook->tab_pos == GTK_POS_LEFT)
+                   {
+                      x -= widget->style->klass->xthickness * 2;
+                      width += widget->style->klass->xthickness * 2;
+                   }
+                 else if (notebook->tab_pos == GTK_POS_RIGHT)
+                   width += widget->style->klass->xthickness * 2;
+              }
+            switch (notebook->tab_pos)
+              {
+               case GTK_POS_TOP:
+                 y += page->allocation.height;
+               case GTK_POS_BOTTOM:
+                 height -= page->allocation.height;
+                 break;
+               case GTK_POS_LEFT:
+                 x += page->allocation.width;
+               case GTK_POS_RIGHT:
+                 width -= page->allocation.width;
+                 break;
+              }
+         }
+     }
+   gdk_draw_rectangle(pm, pmgc, TRUE, x, y, width, height);
+
+   /* if theres an area for scrollign arrows draw the shape for them */
+   if (notebook->panel)
+     {
+       gdk_window_get_geometry(notebook->panel, &x, &y, &width, &height, &depth);
+       gdk_draw_rectangle(pm, pmgc, TRUE, x, y, width, height);
+     }
+   
+   /* draw the shapes of all the children */
+   children = notebook->children;
+   while (children)
+     {
+       page = children->data;
+       if (GTK_WIDGET_MAPPED (page->tab_label))
+         {
+            x = page->allocation.x;
+            y = page->allocation.y;
+            width = page->allocation.width;
+            height = page->allocation.height;
+            gdk_draw_rectangle(pm, pmgc, TRUE, x, y, width, height);
+         }
+       children = children->next;
+     }
+   /* set the mask */
+   gdk_window_shape_combine_mask(widget->window, pm, 0, 0);
+   gdk_pixmap_unref(pm);
+   gdk_gc_destroy(pmgc);
+}
+
+static void
+gtk_notebook_style_set (GtkWidget *widget,
+                     GtkStyle  *previous_style)
+{
+   if (GTK_WIDGET_REALIZED (widget) &&
+       !GTK_WIDGET_NO_WINDOW (widget))
+     {
+       gtk_style_set_background (widget->style, widget->window, widget->state);
+       if (GTK_WIDGET_DRAWABLE (widget))
+         gdk_window_clear (widget->window);
+     }
+   
+   gtk_widget_queue_draw (widget);
+   gtk_notebook_set_shape (GTK_NOTEBOOK(widget));
+}
index 6f520156f30ec4723f592de4d7c9de04d1b48fee..c92aa879d1411b81c6e9cb68e82b879ee27771f5 100644 (file)
@@ -272,11 +272,11 @@ gtk_option_menu_size_request (GtkWidget      *widget,
                        option_menu->width +
                        OPTION_INDICATOR_WIDTH +
                        OPTION_INDICATOR_SPACING * 5 +
-                       CHILD_LEFT_SPACING + CHILD_RIGHT_SPACING);
+                       CHILD_LEFT_SPACING + CHILD_RIGHT_SPACING + 2);
   requisition->height = ((GTK_CONTAINER (widget)->border_width +
                          GTK_WIDGET (widget)->style->klass->ythickness) * 2 +
                         option_menu->height +
-                        CHILD_TOP_SPACING + CHILD_BOTTOM_SPACING);
+                        CHILD_TOP_SPACING + CHILD_BOTTOM_SPACING + 2);
 
   tmp = (requisition->height - option_menu->height +
         OPTION_INDICATOR_HEIGHT + OPTION_INDICATOR_SPACING * 2);
@@ -304,14 +304,14 @@ gtk_option_menu_size_allocate (GtkWidget     *widget,
   if (child && GTK_WIDGET_VISIBLE (child))
     {
       child_allocation.x = (GTK_CONTAINER (widget)->border_width +
-                           GTK_WIDGET (widget)->style->klass->xthickness);
+                           GTK_WIDGET (widget)->style->klass->xthickness) + 1;
       child_allocation.y = (GTK_CONTAINER (widget)->border_width +
-                           GTK_WIDGET (widget)->style->klass->ythickness);
+                           GTK_WIDGET (widget)->style->klass->ythickness) + 1;
       child_allocation.width = (allocation->width - child_allocation.x * 2 -
                                OPTION_INDICATOR_WIDTH - OPTION_INDICATOR_SPACING * 5 -
-                               CHILD_LEFT_SPACING - CHILD_RIGHT_SPACING);
+                               CHILD_LEFT_SPACING - CHILD_RIGHT_SPACING) - 2;
       child_allocation.height = (allocation->height - child_allocation.y * 2 -
-                                CHILD_TOP_SPACING - CHILD_BOTTOM_SPACING);
+                                CHILD_TOP_SPACING - CHILD_BOTTOM_SPACING) - 2;
       child_allocation.x += CHILD_LEFT_SPACING;
       child_allocation.y += CHILD_RIGHT_SPACING;
 
@@ -323,8 +323,7 @@ static void
 gtk_option_menu_paint (GtkWidget    *widget,
                       GdkRectangle *area)
 {
-  GdkRectangle restrict_area;
-  GdkRectangle new_area;
+  GdkRectangle button_area;
 
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_OPTION_MENU (widget));
@@ -332,30 +331,39 @@ gtk_option_menu_paint (GtkWidget    *widget,
 
   if (GTK_WIDGET_DRAWABLE (widget))
     {
-      restrict_area.x = GTK_CONTAINER (widget)->border_width;
-      restrict_area.y = GTK_CONTAINER (widget)->border_width;
-      restrict_area.width = widget->allocation.width - restrict_area.x * 2;
-      restrict_area.height = widget->allocation.height - restrict_area.y * 2;
-
-      if (gdk_rectangle_intersect (area, &restrict_area, &new_area))
-       {
-         gtk_style_set_background (widget->style, widget->window, GTK_WIDGET_STATE (widget));
-         gdk_window_clear_area (widget->window,
-                                new_area.x, new_area.y,
-                                new_area.width, new_area.height);
-
-         gtk_draw_shadow (widget->style, widget->window,
-                          GTK_WIDGET_STATE (widget), GTK_SHADOW_OUT,
-                          restrict_area.x, restrict_area.y,
-                          restrict_area.width, restrict_area.height);
-
-         gtk_draw_shadow (widget->style, widget->window,
-                          GTK_WIDGET_STATE (widget), GTK_SHADOW_OUT,
-                          restrict_area.x + restrict_area.width - restrict_area.x -
-                          OPTION_INDICATOR_WIDTH - OPTION_INDICATOR_SPACING * 4,
-                          restrict_area.y + (restrict_area.height - OPTION_INDICATOR_HEIGHT) / 2,
-                          OPTION_INDICATOR_WIDTH, OPTION_INDICATOR_HEIGHT);
-       }
+      button_area.x = GTK_CONTAINER (widget)->border_width + 1;
+      button_area.y = GTK_CONTAINER (widget)->border_width + 1;
+      button_area.width = widget->allocation.width - button_area.x * 2;
+      button_area.height = widget->allocation.height - button_area.y * 2;
+
+      /* This is evil, and should be elimated here and in the button
+       * code. The point is to clear the focus, and make it
+       * sort of transparent if it isn't there.
+       */
+      gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
+      gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height);
+
+      gtk_paint_box(widget->style, widget->window,
+                   GTK_WIDGET_STATE (widget), GTK_SHADOW_OUT,
+                   area, widget, "optionmenu",
+                   button_area.x, button_area.y,
+                   button_area.width, button_area.height);
+      
+      gtk_paint_tab (widget->style, widget->window,
+                    GTK_WIDGET_STATE (widget), GTK_SHADOW_OUT,
+                    area, widget, "optionmenutab",
+                    button_area.x + button_area.width - button_area.x -
+                    OPTION_INDICATOR_WIDTH - OPTION_INDICATOR_SPACING * 4,
+                    button_area.y + (button_area.height - OPTION_INDICATOR_HEIGHT) / 2,
+                    OPTION_INDICATOR_WIDTH, OPTION_INDICATOR_HEIGHT);
+      
+      if (GTK_WIDGET_HAS_FOCUS (widget))
+       gtk_paint_focus (widget->style, widget->window,
+                        area, widget, "button",
+                        button_area.x - 1, 
+                        button_area.y - 1, 
+                        button_area.width + 1,
+                        button_area.height + 1);
     }
 }
 
@@ -377,7 +385,6 @@ gtk_option_menu_draw (GtkWidget    *widget,
       child = GTK_BIN (widget)->child;
       if (child && gtk_widget_intersect (child, area, &child_area))
        gtk_widget_draw (child, &child_area);
-      gtk_widget_draw_focus (widget);
     }
 }
 
@@ -440,7 +447,6 @@ gtk_option_menu_expose (GtkWidget      *widget,
        gtk_widget_event (child, (GdkEvent*) &child_event);
 
 #endif /* 0 */
-      gtk_widget_draw_focus (widget);
     }
 
   return FALSE;
index e30b9747e2cdd33631d8f1e642290488eca83912..ae4da2a5e9170b95b40ec9f46509bf37bb0ed0d4 100644 (file)
@@ -31,10 +31,10 @@ static void gtk_paned_add        (GtkContainer   *container,
                                  GtkWidget      *widget);
 static void gtk_paned_remove     (GtkContainer   *container,
                                  GtkWidget      *widget);
-static void gtk_paned_forall   (GtkContainer   *container,
-                               gboolean        include_internals,
-                               GtkCallback     callback,
-                               gpointer        callback_data);
+static void gtk_paned_forall     (GtkContainer   *container,
+                                 gboolean        include_internals,
+                                 GtkCallback     callback,
+                                 gpointer        callback_data);
 static GtkType gtk_paned_child_type (GtkContainer *container);
 
 
@@ -167,6 +167,8 @@ gtk_paned_realize (GtkWidget *widget)
   
   gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
   gtk_style_set_background (widget->style, paned->handle, GTK_STATE_NORMAL);
+
+  gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
   
   gdk_window_show (paned->handle);
 }
@@ -252,13 +254,12 @@ gtk_paned_expose (GtkWidget      *widget,
       /* An expose event for the handle */
       if (event->window == paned->handle)
        {
-         gdk_window_set_background (paned->handle,
-                                    &widget->style->bg[widget->state]);
-         gdk_window_clear (paned->handle);
-         gtk_draw_shadow (widget->style, paned->handle,
-                          GTK_WIDGET_STATE(widget),
-                          GTK_SHADOW_OUT, 0, 0,
-                          paned->handle_size, paned->handle_size);
+          gtk_paint_box (widget->style, paned->handle,
+                         GTK_WIDGET_STATE(widget),
+                         GTK_SHADOW_OUT, 
+                         &event->area, widget, "paned",
+                         0, 0,
+                         paned->handle_size, paned->handle_size);
        }
       else
        {
index 7a3cfb68484bacd956502adbd0d495c97a3de16c..9cc6ec007676ef55c2de436ca15f7be21df17650 100644 (file)
@@ -74,7 +74,6 @@ gtk_pixmap_init (GtkPixmap *pixmap)
 
   pixmap->pixmap = NULL;
   pixmap->mask = NULL;
-  pixmap->needs_clear = FALSE;
 }
 
 GtkWidget*
@@ -82,13 +81,13 @@ gtk_pixmap_new (GdkPixmap *val,
                GdkBitmap *mask)
 {
   GtkPixmap *pixmap;
-
+   
   g_return_val_if_fail (val != NULL, NULL);
-
+  
   pixmap = gtk_type_new (gtk_pixmap_get_type ());
-
+  
   gtk_pixmap_set (pixmap, val, mask);
-
+  
   return GTK_WIDGET (pixmap);
 }
 
@@ -135,20 +134,11 @@ gtk_pixmap_set (GtkPixmap *pixmap,
        }
       if (GTK_WIDGET_VISIBLE (pixmap))
        {
-         /* If we aren't drawing the entire area, clear first */
-         if (GTK_WIDGET_DRAWABLE (pixmap) && 
-             ((mask != NULL) || 
-              (GTK_WIDGET (pixmap)->requisition.width != oldwidth) ||
-              (GTK_WIDGET (pixmap)->requisition.height != oldheight)))
-           {
-             pixmap->needs_clear = TRUE;
-           }
-
          if ((GTK_WIDGET (pixmap)->requisition.width != oldwidth) ||
              (GTK_WIDGET (pixmap)->requisition.height != oldheight))
            gtk_widget_queue_resize (GTK_WIDGET (pixmap));
          else
-           gtk_widget_queue_draw (GTK_WIDGET (pixmap));
+           gtk_widget_queue_clear (GTK_WIDGET (pixmap));
        }
     }
 
@@ -194,17 +184,6 @@ gtk_pixmap_expose (GtkWidget      *widget,
       pixmap = GTK_PIXMAP (widget);
       misc = GTK_MISC (widget);
 
-      if (pixmap->needs_clear)
-       {
-          gdk_window_clear_area (GTK_WIDGET (pixmap)->window,
-                                GTK_WIDGET (pixmap)->allocation.x,
-                                GTK_WIDGET (pixmap)->allocation.y,
-                                GTK_WIDGET (pixmap)->allocation.width,
-                                GTK_WIDGET (pixmap)->allocation.height);
-         
-         pixmap->needs_clear = FALSE;
-       }
-
       x = (widget->allocation.x * (1.0 - misc->xalign) +
           (widget->allocation.x + widget->allocation.width
            - (widget->requisition.width - misc->xpad * 2)) *
@@ -231,6 +210,5 @@ gtk_pixmap_expose (GtkWidget      *widget,
          gdk_gc_set_clip_origin (widget->style->black_gc, 0, 0);
        }
     }
-
   return FALSE;
 }
index fa46a3c613ab05e5aa2e8af6a91360c0005d526e..1694579ab47e27eb25566a7a83a8423eaba7b9a5 100644 (file)
@@ -45,8 +45,6 @@ struct _GtkPixmap
   
   GdkPixmap *pixmap;
   GdkBitmap *mask;
-
-  guint needs_clear : 1;
 };
 
 struct _GtkPixmapClass
index 6490fca6da24e6a14d3919d2482a7ab14c34cdfc..076310137afdb4fbdcdc08067aa45b938cdebb41 100644 (file)
@@ -423,6 +423,7 @@ gtk_preview_realize (GtkWidget *widget)
 
   widget->style = gtk_style_attach (widget->style, widget->window);
   gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
+  gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
 }
 
 static gint
index 86ddec16906c81371dda97b0deb84e647cac840c..429f8a435de054118e7daac4f2cf43764c176223 100644 (file)
@@ -379,72 +379,47 @@ gtk_progress_bar_paint (GtkProgress *progress)
 
   if (progress->offscreen_pixmap)
     {
-      gtk_draw_shadow (widget->style,
-                      progress->offscreen_pixmap,
-                      GTK_STATE_NORMAL, GTK_SHADOW_IN, 0, 0,
-                      widget->allocation.width,
-                      widget->allocation.height);
-         
-      gdk_draw_rectangle (progress->offscreen_pixmap,
-                         widget->style->bg_gc[GTK_STATE_ACTIVE], TRUE,
-                         widget->style->klass->xthickness,
-                         widget->style->klass->ythickness,
-                         widget->allocation.width -
-                         widget->style->klass->xthickness * 2,
-                         widget->allocation.height -
-                         widget->style->klass->ythickness * 2);
-
+      gtk_paint_box (widget->style,
+                    progress->offscreen_pixmap,
+                    GTK_STATE_NORMAL, GTK_SHADOW_IN, 
+                    NULL, widget, "trough",
+                    0, 0,
+                    widget->allocation.width,
+                    widget->allocation.height);
+      
       if (progress->activity_mode)
        {
          if (pbar->orientation == GTK_PROGRESS_LEFT_TO_RIGHT ||
              pbar->orientation == GTK_PROGRESS_RIGHT_TO_LEFT)
            {
              size = MAX (2, widget->allocation.width / pbar->activity_blocks);
-
-             gdk_draw_rectangle (progress->offscreen_pixmap,
-                                 widget->style->bg_gc[GTK_STATE_PRELIGHT],
-                                 TRUE,
-                                 pbar->activity_pos,
-                                 widget->style->klass->ythickness,
-                                 size,
-                                 widget->allocation.height - 
-                                 widget->style->klass->ythickness * 2);
              
-             gtk_draw_shadow (widget->style,
-                              progress->offscreen_pixmap,
-                              GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
-                              pbar->activity_pos,
-                              widget->style->klass->ythickness,
-                              size,
-                              widget->allocation.height -
-                              widget->style->klass->ythickness * 2);
+             gtk_paint_box (widget->style,
+                            progress->offscreen_pixmap,
+                            GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
+                            NULL, widget, "bar",
+                            pbar->activity_pos,
+                            widget->style->klass->ythickness,
+                            size,
+                            widget->allocation.height - widget->style->klass->ythickness * 2);
              return;
            }
          else
            {
              size = MAX (2, widget->allocation.height / pbar->activity_blocks);
-
-             gdk_draw_rectangle (progress->offscreen_pixmap,
-                                 widget->style->bg_gc[GTK_STATE_PRELIGHT],
-                                 TRUE,
-                                 widget->style->klass->xthickness,
-                                 pbar->activity_pos,
-                                 widget->allocation.width - 
-                                 widget->style->klass->xthickness * 2,
-                                 size);
              
-             gtk_draw_shadow (widget->style,
-                              progress->offscreen_pixmap,
-                              GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
-                              widget->style->klass->xthickness,
-                              pbar->activity_pos,
-                              widget->allocation.width -
-                              widget->style->klass->xthickness * 2,
-                              size);
+             gtk_paint_box (widget->style,
+                            progress->offscreen_pixmap,
+                            GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
+                            NULL, widget, "bar",
+                            widget->style->klass->xthickness,
+                            pbar->activity_pos,
+                            widget->allocation.width - widget->style->klass->xthickness * 2,
+                            size);
              return;
            }
        }
-
+      
       amount = percentage * space;
       
       if (amount > 0)
@@ -456,22 +431,14 @@ gtk_progress_bar_paint (GtkProgress *progress)
              
              if (pbar->bar_style == GTK_PROGRESS_CONTINUOUS)
                {
-                 gdk_draw_rectangle (progress->offscreen_pixmap,
-                                     widget->style->bg_gc[GTK_STATE_PRELIGHT],
-                                     TRUE,
-                                     widget->style->klass->xthickness,
-                                     widget->style->klass->ythickness,
-                                     amount,
-                                     widget->allocation.height - 
-                                     widget->style->klass->ythickness * 2);
-                 gtk_draw_shadow (widget->style,
-                                  progress->offscreen_pixmap,
-                                  GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
-                                  widget->style->klass->xthickness,
-                                  widget->style->klass->ythickness,
-                                  amount,
-                                  widget->allocation.height -
-                                  widget->style->klass->ythickness * 2);
+                 gtk_paint_box (widget->style,
+                                progress->offscreen_pixmap,
+                                GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
+                                NULL, widget, "bar",
+                                widget->style->klass->xthickness,
+                                widget->style->klass->ythickness,
+                                amount,
+                                widget->allocation.height - widget->style->klass->ythickness * 2);
                }
              else
                {
@@ -482,82 +449,56 @@ gtk_progress_bar_paint (GtkProgress *progress)
                      block_delta = (((i + 1) * space) / pbar->blocks)
                        - ((i * space) / pbar->blocks);
                      
-                     gdk_draw_rectangle 
-                       (progress->offscreen_pixmap,
-                        widget->style->bg_gc[GTK_STATE_PRELIGHT],
-                        TRUE,
-                        x,
-                        widget->style->klass->ythickness,
-                        block_delta,
-                        widget->allocation.height - 
-                        widget->style->klass->ythickness * 2);
-
-                     gtk_draw_shadow (widget->style,
-                                      progress->offscreen_pixmap,
-                                      GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
-                                      x,
-                                      widget->style->klass->ythickness,
-                                      block_delta,
-                                      widget->allocation.height -
-                                      widget->style->klass->ythickness * 2);
-
+                     gtk_paint_box (widget->style,
+                                    progress->offscreen_pixmap,
+                                    GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
+                                    NULL, widget, "bar",
+                                    x,
+                                    widget->style->klass->ythickness,
+                                    block_delta,
+                                    widget->allocation.height - widget->style->klass->ythickness * 2);
+                     
                      x +=  block_delta;
                    }
                }
              break;
-
+             
            case GTK_PROGRESS_RIGHT_TO_LEFT:
-
+             
              if (pbar->bar_style == GTK_PROGRESS_CONTINUOUS)
                {
-                 gdk_draw_rectangle (progress->offscreen_pixmap,
-                                     widget->style->bg_gc[GTK_STATE_PRELIGHT],
-                                     TRUE,
-                                     widget->allocation.width - 
-                                     widget->style->klass->xthickness - amount,
-                                     widget->style->klass->ythickness,
-                                     amount,
-                                     widget->allocation.height - 
-                                     widget->style->klass->ythickness * 2);
-                 gtk_draw_shadow (widget->style,
-                                  progress->offscreen_pixmap,
-                                  GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
-                                  widget->allocation.width - 
-                                  widget->style->klass->xthickness - amount,
-                                  widget->style->klass->ythickness,
-                                  amount,
-                                  widget->allocation.height -
-                                  widget->style->klass->ythickness * 2);
+                 gtk_paint_box (widget->style,
+                                progress->offscreen_pixmap,
+                                GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
+                                NULL, widget, "bar",
+                                widget->allocation.width - 
+                                widget->style->klass->xthickness - amount,
+                                widget->style->klass->ythickness,
+                                amount,
+                                widget->allocation.height -
+                                widget->style->klass->ythickness * 2);
                }
              else
                {
                  x = widget->allocation.width - 
                    widget->style->klass->xthickness;
-
+                 
                  for (i = 0; i <= pbar->in_block; i++)
                    {
                      block_delta = (((i + 1) * space) / pbar->blocks) -
                        ((i * space) / pbar->blocks);
-
+                     
                      x -=  block_delta;
-
-                     gdk_draw_rectangle (progress->offscreen_pixmap,
-                                 widget->style->bg_gc[GTK_STATE_PRELIGHT],
-                                 TRUE,
-                                 x,
-                                 widget->style->klass->ythickness,
-                                 block_delta,
-                                 widget->allocation.height - 
-                                 widget->style->klass->ythickness * 2);
-
-                     gtk_draw_shadow (widget->style,
-                                      progress->offscreen_pixmap,
-                                      GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
-                                      x,
-                                      widget->style->klass->ythickness,
-                                      block_delta,
-                                      widget->allocation.height -
-                                      widget->style->klass->ythickness * 2);
+                     
+                     gtk_paint_box (widget->style,
+                                    progress->offscreen_pixmap,
+                                    GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
+                                    NULL, widget, "bar",
+                                    x,
+                                    widget->style->klass->ythickness,
+                                    block_delta,
+                                    widget->allocation.height -
+                                    widget->style->klass->ythickness * 2);
                    }
                }
              break;
@@ -566,119 +507,86 @@ gtk_progress_bar_paint (GtkProgress *progress)
 
              if (pbar->bar_style == GTK_PROGRESS_CONTINUOUS)
                {
-                 gdk_draw_rectangle (progress->offscreen_pixmap,
-                                     widget->style->bg_gc[GTK_STATE_PRELIGHT],
-                                     TRUE,
-                                     widget->style->klass->xthickness,
-                                     widget->allocation.height - 
-                                     widget->style->klass->ythickness - amount,
-                                     widget->allocation.width - 
-                                     widget->style->klass->xthickness * 2,
-                                     amount);
-                 gtk_draw_shadow (widget->style,
-                                  progress->offscreen_pixmap,
-                                  GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
-                                  widget->style->klass->xthickness,
-                                  widget->allocation.height - 
-                                  widget->style->klass->ythickness - amount,
-                                  widget->allocation.width -
-                                  widget->style->klass->xthickness * 2,
-                                  amount);
+                 gtk_paint_box (widget->style,
+                                progress->offscreen_pixmap,
+                                GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
+                                NULL, widget, "bar",
+                                widget->style->klass->xthickness,
+                                widget->allocation.height - 
+                                widget->style->klass->ythickness - amount,
+                                widget->allocation.width -
+                                widget->style->klass->xthickness * 2,
+                                amount);
                }
              else
                {
                  y = widget->allocation.height - 
                    widget->style->klass->ythickness;
-
+                 
                  for (i = 0; i <= pbar->in_block; i++)
                    {
                      block_delta = (((i + 1) * space) / pbar->blocks) -
                        ((i * space) / pbar->blocks);
                      
                      y -= block_delta;
-
-                     gdk_draw_rectangle 
-                       (progress->offscreen_pixmap,
-                        widget->style->bg_gc[GTK_STATE_PRELIGHT],
-                        TRUE,
-                        widget->style->klass->xthickness,
-                        y,
-                        widget->allocation.width - 
-                        widget->style->klass->xthickness * 2,
-                        block_delta);
-
-                     gtk_draw_shadow (widget->style,
-                                      progress->offscreen_pixmap,
-                                      GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
-                                      widget->style->klass->xthickness,
-                                      y,
-                                      widget->allocation.width - 
-                                      widget->style->klass->xthickness * 2,
-                                      block_delta);
+                     
+                     gtk_paint_box (widget->style,
+                                    progress->offscreen_pixmap,
+                                    GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
+                                    NULL, widget, "bar",
+                                    widget->style->klass->xthickness,
+                                    y,
+                                    widget->allocation.width - 
+                                    widget->style->klass->xthickness * 2,
+                                    block_delta);
                    }
                }
              break;
-
+             
            case GTK_PROGRESS_TOP_TO_BOTTOM:
-
+             
              if (pbar->bar_style == GTK_PROGRESS_CONTINUOUS)
                {
-                 gdk_draw_rectangle (progress->offscreen_pixmap,
-                                     widget->style->bg_gc[GTK_STATE_PRELIGHT],
-                                     TRUE,
-                                     widget->style->klass->xthickness,
-                                     widget->style->klass->ythickness,
-                                     widget->allocation.width -
-                                     widget->style->klass->xthickness * 2,
-                                     amount);
-                 gtk_draw_shadow (widget->style,
-                                  progress->offscreen_pixmap,
-                                  GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
-                                  widget->style->klass->xthickness,
-                                  widget->style->klass->ythickness,
-                                  widget->allocation.width -
-                                  widget->style->klass->xthickness * 2,
-                                  amount);
+                 gtk_paint_box (widget->style,
+                                progress->offscreen_pixmap,
+                                GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
+                                NULL, widget, "bar",
+                                widget->style->klass->xthickness,
+                                widget->style->klass->ythickness,
+                                widget->allocation.width -
+                                widget->style->klass->xthickness * 2,
+                                amount);
                }
              else
                {
                  y = widget->style->klass->ythickness;
-
+                 
                  for (i = 0; i <= pbar->in_block; i++)
                    {
-
+                     
                      block_delta = (((i + 1) * space) / pbar->blocks)
                        - ((i * space) / pbar->blocks);
-
-                     gdk_draw_rectangle
-                       (progress->offscreen_pixmap,
-                        widget->style->bg_gc[GTK_STATE_PRELIGHT],
-                        TRUE,
-                        widget->style->klass->xthickness,
-                        y,
-                        widget->allocation.width -
-                        widget->style->klass->xthickness * 2,
-                        block_delta);
-
-                     gtk_draw_shadow (widget->style,
-                                      progress->offscreen_pixmap,
-                                      GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
-                                      widget->style->klass->xthickness,
-                                      y,
-                                      widget->allocation.width -
-                                      widget->style->klass->xthickness * 2,
-                                      block_delta);
-
+                     
+                     gtk_paint_box (widget->style,
+                                    progress->offscreen_pixmap,
+                                    GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
+                                    NULL, widget, "bar",
+                                    widget->style->klass->xthickness,
+                                    y,
+                                    widget->allocation.width -
+                                    widget->style->klass->xthickness * 2,
+                                    block_delta);
+                     
                      y += block_delta;
                    }
                }
              break;
-
+             
            default:
              break;
            }
        }
-
+      
       if (progress->show_text && pbar->bar_style != GTK_PROGRESS_DISCRETE)
        {
          gint x;
index ee1a80f6793a5131ee84096207f8e26b56294e06..33c78e76eab01163210625ff5b69a79ad7fd8272 100644 (file)
@@ -98,6 +98,7 @@ gtk_radio_button_class_init (GtkRadioButtonClass *class)
 static void
 gtk_radio_button_init (GtkRadioButton *radio_button)
 {
+  GTK_WIDGET_SET_FLAGS (radio_button, GTK_NO_WINDOW);
   radio_button->group = g_slist_prepend (NULL, radio_button);
 }
 
@@ -358,7 +359,6 @@ gtk_radio_button_draw_indicator (GtkCheckButton *check_button,
   GtkShadowType shadow_type;
   GdkRectangle restrict_area;
   GdkRectangle new_area;
-  GdkPoint pts[4];
   gint width, height;
   gint x, y;
 
@@ -376,43 +376,34 @@ gtk_radio_button_draw_indicator (GtkCheckButton *check_button,
          (state_type != GTK_STATE_PRELIGHT))
        state_type = GTK_STATE_NORMAL;
 
-      restrict_area.x = GTK_CONTAINER (widget)->border_width;
-      restrict_area.y = restrict_area.x;
-      restrict_area.width = widget->allocation.width - restrict_area.x * 2;
-      restrict_area.height = widget->allocation.height - restrict_area.x * 2;
+      restrict_area.x = widget->allocation.x + GTK_CONTAINER (widget)->border_width;
+      restrict_area.y = widget->allocation.y + GTK_CONTAINER (widget)->border_width;
+      restrict_area.width = widget->allocation.width - ( 2 * GTK_CONTAINER (widget)->border_width);
+      restrict_area.height = widget->allocation.height - ( 2 * GTK_CONTAINER (widget)->border_width);
 
       if (gdk_rectangle_intersect (area, &restrict_area, &new_area))
        {
-         gtk_style_set_background (widget->style, widget->window, state_type);
-         gdk_window_clear_area (widget->window, new_area.x, new_area.y,
-                                new_area.width, new_area.height);
+          if (state_type != GTK_STATE_NORMAL)
+            gtk_paint_flat_box(widget->style, widget->window, state_type, 
+                               GTK_SHADOW_ETCHED_OUT,
+                               area, widget, "radiobutton",
+                               new_area.x, new_area.y,
+                               new_area.width, new_area.height);
        }
       
-      x = CHECK_BUTTON_CLASS (widget)->indicator_spacing + GTK_CONTAINER (widget)->border_width;
-      y = (widget->allocation.height - CHECK_BUTTON_CLASS (widget)->indicator_size) / 2;
+      x = widget->allocation.x + CHECK_BUTTON_CLASS (widget)->indicator_spacing + GTK_CONTAINER (widget)->border_width;
+      y = widget->allocation.y + (widget->allocation.height - CHECK_BUTTON_CLASS (widget)->indicator_size) / 2;
       width = CHECK_BUTTON_CLASS (widget)->indicator_size;
       height = CHECK_BUTTON_CLASS (widget)->indicator_size;
-
+      
       if (GTK_TOGGLE_BUTTON (widget)->active)
        shadow_type = GTK_SHADOW_IN;
       else
        shadow_type = GTK_SHADOW_OUT;
-
-      pts[0].x = x + width / 2;
-      pts[0].y = y;
-      pts[1].x = x + width;
-      pts[1].y = y + height / 2;
-      pts[2].x = pts[0].x;
-      pts[2].y = y + height;
-      pts[3].x = x;
-      pts[3].y = pts[1].y;
-
-      gdk_draw_polygon (widget->window,
-                       widget->style->bg_gc[GTK_WIDGET_STATE (widget)],
-                       TRUE, pts, 4);
-      gtk_draw_diamond (widget->style, widget->window,
+      
+      gtk_paint_option (widget->style, widget->window,
                        GTK_WIDGET_STATE (widget), shadow_type,
+                       area, widget, "radiobutton",
                        x, y, width, height);
     }
 }
-
index c6cb6d6b2b4a42dde17f92727eb84b3ebfeb349a..482bcdd85d2f090fc7961e4f2e65a6e4dbeba5c5 100644 (file)
@@ -227,7 +227,6 @@ gtk_radio_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
   GtkWidget *widget;
   GtkStateType state_type;
   GtkShadowType shadow_type;
-  GdkPoint pts[4];
   gint width, height;
   gint x, y;
 
@@ -244,8 +243,6 @@ gtk_radio_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
           widget->style->klass->xthickness + 2);
       y = (widget->allocation.height - height) / 2;
 
-      gdk_window_clear_area (widget->window, x, y, width, height);
-
       if (check_menu_item->active ||
          check_menu_item->always_show_toggle ||
          (GTK_WIDGET_STATE (check_menu_item) == GTK_STATE_PRELIGHT))
@@ -257,20 +254,9 @@ gtk_radio_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
          else
            shadow_type = GTK_SHADOW_OUT;
 
-         pts[0].x = x + width / 2;
-         pts[0].y = y;
-         pts[1].x = x + width;
-         pts[1].y = y + height / 2;
-         pts[2].x = pts[0].x;
-         pts[2].y = y + height;
-         pts[3].x = x;
-         pts[3].y = pts[1].y;
-
-         gdk_draw_polygon (widget->window,
-                           widget->style->bg_gc[state_type],
-                           TRUE, pts, 4);
-         gtk_draw_diamond (widget->style, widget->window,
+         gtk_paint_option (widget->style, widget->window,
                            state_type, shadow_type,
+                           area, widget, "option",
                            x, y, width, height);
        }
     }
index ae79bb6ef5336c836f13bb0c591c87738d310571..b3affe3da8f8a821b36a72e59fca7cc7c13dbabb 100644 (file)
@@ -142,6 +142,7 @@ gtk_range_class_init (GtkRangeClass *class)
   class->step_forw = 3;
   class->step_back = 4;
   class->draw_background = NULL;
+  class->clear_background = NULL;
   class->draw_trough = gtk_real_range_draw_trough;
   class->draw_slider = gtk_real_range_draw_slider;
   class->draw_step_forw = NULL;
@@ -244,6 +245,16 @@ gtk_range_draw_background (GtkRange *range)
     (* RANGE_CLASS (range)->draw_background) (range);
 }
 
+void
+gtk_range_clear_background (GtkRange *range)
+{
+  g_return_if_fail (range != NULL);
+  g_return_if_fail (GTK_IS_RANGE (range));
+
+  if (range->trough && RANGE_CLASS (range)->clear_background)
+    (* RANGE_CLASS (range)->clear_background) (range);
+}
+
 void
 gtk_range_draw_trough (GtkRange *range)
 {
@@ -532,7 +543,7 @@ gtk_range_default_hmotion (GtkRange *range,
       else
        {
          gtk_range_slider_update (range);
-         gtk_range_draw_background (range);
+         gtk_range_clear_background (range);
 
          if (range->policy == GTK_UPDATE_DELAYED)
            {
@@ -597,7 +608,7 @@ gtk_range_default_vmotion (GtkRange *range,
       else
        {
          gtk_range_slider_update (range);
-         gtk_range_draw_background (range);
+         gtk_range_clear_background (range);
 
          if (range->policy == GTK_UPDATE_DELAYED)
            {
@@ -717,7 +728,6 @@ gtk_range_expose (GtkWidget      *widget,
        * trough-drawing handler. (Probably should really pass another
        * argument - the redrawn area to all the drawing functions)
        */
-
       gint xt = widget->style->klass->xthickness;
       gint yt = widget->style->klass->ythickness;
       
@@ -983,7 +993,7 @@ gtk_range_key_press (GtkWidget   *widget,
                                       "value_changed");
 
              gtk_range_slider_update (range);
-             gtk_range_draw_background (range);
+             gtk_range_clear_background (range);
            }
        }
     }
@@ -1108,23 +1118,16 @@ gtk_real_range_draw_trough (GtkRange *range)
   g_return_if_fail (GTK_IS_RANGE (range));
 
   if (range->trough)
-    {
-      gtk_draw_shadow (GTK_WIDGET (range)->style, range->trough,
-                       GTK_STATE_NORMAL, GTK_SHADOW_IN,
-                       0, 0, -1, -1);
-
-      if (GTK_WIDGET_HAS_FOCUS (range))
-        gdk_draw_rectangle (GTK_WIDGET (range)->window,
-                            GTK_WIDGET (range)->style->black_gc,
-                            FALSE, 0, 0,
-                            GTK_WIDGET (range)->allocation.width - 1,
-                            GTK_WIDGET (range)->allocation.height - 1);
-      else if (range->trough != GTK_WIDGET (range)->window)
-        gdk_draw_rectangle (GTK_WIDGET (range)->window,
-                            GTK_WIDGET (range)->style->bg_gc[GTK_STATE_NORMAL],
-                            FALSE, 0, 0,
-                            GTK_WIDGET (range)->allocation.width - 1,
-                            GTK_WIDGET (range)->allocation.height - 1);
+     {
+       gtk_paint_box (GTK_WIDGET (range)->style, range->trough,
+                      GTK_STATE_ACTIVE, GTK_SHADOW_IN,
+                      NULL, GTK_WIDGET(range), "trough",
+                      0, 0, -1, -1);
+       if (GTK_WIDGET_HAS_FOCUS (range))
+         gtk_paint_focus (GTK_WIDGET (range)->style,
+                         range->trough,
+                          NULL, GTK_WIDGET(range), "trough",
+                         0, 0, -1, -1);
     }
 }
 
@@ -1132,10 +1135,10 @@ static void
 gtk_real_range_draw_slider (GtkRange *range)
 {
   GtkStateType state_type;
-
+   
   g_return_if_fail (range != NULL);
   g_return_if_fail (GTK_IS_RANGE (range));
-
+   
   if (range->slider)
     {
       if ((range->in_child == RANGE_CLASS (range)->slider) ||
@@ -1143,13 +1146,10 @@ gtk_real_range_draw_slider (GtkRange *range)
        state_type = GTK_STATE_PRELIGHT;
       else
        state_type = GTK_STATE_NORMAL;
-
-      gtk_style_set_background (GTK_WIDGET (range)->style, range->slider, state_type);
-      gdk_window_clear (range->slider);
-
-      gtk_draw_shadow (GTK_WIDGET (range)->style, range->slider,
-                      state_type, GTK_SHADOW_OUT,
-                      0, 0, -1, -1);
+      gtk_paint_box (GTK_WIDGET (range)->style, range->slider,
+                    state_type, GTK_SHADOW_OUT,
+                    NULL, GTK_WIDGET (range), "slider",
+                    0, 0, -1, -1);
     }
 }
 
@@ -1289,7 +1289,7 @@ gtk_range_scroll (GtkRange *range,
       else
        {
          gtk_range_slider_update (range);
-         gtk_range_draw_background (range);
+         gtk_range_clear_background (range);
        }
     }
 
@@ -1356,7 +1356,7 @@ gtk_range_adjustment_changed (GtkAdjustment *adjustment,
       (range->old_page_size != adjustment->page_size))
     {
       gtk_range_slider_update (range);
-      gtk_range_draw_background (range);
+      gtk_range_clear_background (range);
 
       range->old_value = adjustment->value;
       range->old_lower = adjustment->lower;
@@ -1379,7 +1379,7 @@ gtk_range_adjustment_value_changed (GtkAdjustment *adjustment,
   if (range->old_value != adjustment->value)
     {
       gtk_range_slider_update (range);
-      gtk_range_draw_background (range);
+      gtk_range_clear_background (range);
 
       range->old_value = adjustment->value;
     }
@@ -1474,7 +1474,7 @@ gtk_range_style_set (GtkWidget *widget,
   if (GTK_WIDGET_REALIZED (widget) &&
       !GTK_WIDGET_NO_WINDOW (widget))
     {
-      if (range->trough)
+       if (range->trough)
        {
          gtk_style_set_background (widget->style, range->trough, GTK_STATE_ACTIVE);
          if (GTK_WIDGET_DRAWABLE (widget))
@@ -1494,5 +1494,6 @@ gtk_range_style_set (GtkWidget *widget,
          if (GTK_WIDGET_DRAWABLE (widget))
            gdk_window_clear (range->step_back);
        }
+       gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
     }
 }
index f51491b1d89d7e5ff1406554ddc5b11a2fd3ef84..48da24c6593d0a8a995df589bbebe20dc9c76a00 100644 (file)
@@ -82,7 +82,8 @@ struct _GtkRangeClass
   guint8 step_forw;
   guint8 step_back;
 
-  void (* draw_background) (GtkRange *range);
+  void (* draw_background)  (GtkRange *range);
+  void (* clear_background) (GtkRange *range);
   void (* draw_trough)     (GtkRange *range);
   void (* draw_slider)     (GtkRange *range);
   void (* draw_step_forw)  (GtkRange *range);
@@ -111,6 +112,7 @@ void           gtk_range_set_adjustment         (GtkRange      *range,
                                                 GtkAdjustment *adjustment);
 
 void           gtk_range_draw_background        (GtkRange      *range);
+void           gtk_range_clear_background        (GtkRange      *range);
 void           gtk_range_draw_trough            (GtkRange      *range);
 void           gtk_range_draw_slider            (GtkRange      *range);
 void           gtk_range_draw_step_forw         (GtkRange      *range);
index 84b24c24ec7191f25add2f15f941dbaca19e3de8..0f3767a03a238043a63153cfbba9b2387efcc7b8 100644 (file)
 #include <stdio.h>
 #include "gtkrc.h"
 #include "gtkbindings.h"
+#include "gtkthemes.h"
 
-
-typedef struct _GtkRcStyle  GtkRcStyle;
 typedef struct _GtkRcSet    GtkRcSet;
 typedef struct _GtkRcNode   GtkRcNode;
 typedef struct _GtkRcFile   GtkRcFile;
 
-struct _GtkRcNode
-{
-  GdkColormap *cmap;
-  GtkStyle *style;
-};
-
-struct _GtkRcStyle
-{
-  char *name;
-  char *font_name;
-  char *fontset_name;
-  char *bg_pixmap_name[5];
-  GtkStyle *proto_style;
-  GList *styles;
-};
-
 struct _GtkRcSet
 {
   GtkPatternSpec pspec;
@@ -65,13 +48,17 @@ struct _GtkRcFile
 static guint      gtk_rc_style_hash               (const char   *name);
 static gint       gtk_rc_style_compare            (const char   *a,
                                                    const char   *b);
+static guint      gtk_rc_styles_hash              (const GSList *rc_styles);
+static gint       gtk_rc_styles_compare           (const GSList *a,
+                                                   const GSList *b);
 static GtkRcStyle* gtk_rc_style_find              (const char   *name);
-static GtkRcStyle* gtk_rc_styles_match            (GSList       *sets,
-                                                   guint         path_length,
-                                                   gchar        *path,
-                                                   gchar        *path_reversed);
-static GtkStyle*   gtk_rc_style_init              (GtkRcStyle   *rc_style,
-                                                   GdkColormap  *cmap);
+static GSList *    gtk_rc_styles_match             (GSList       *rc_styles,
+                                                   GSList       *sets,
+                                                   guint         path_length,
+                                                   gchar        *path,
+                                                   gchar        *path_reversed);
+static GtkStyle *  gtk_rc_style_to_style           (GtkRcStyle   *rc_style);
+static GtkStyle*   gtk_rc_style_init              (GSList       *rc_styles);
 static void        gtk_rc_parse_file               (const gchar  *filename,
                                                    gboolean      reload);
 
@@ -81,29 +68,33 @@ static void    gtk_rc_parse_any                (const gchar  *input_name,
 static guint      gtk_rc_parse_statement          (GScanner     *scanner);
 static guint      gtk_rc_parse_style              (GScanner     *scanner);
 static guint      gtk_rc_parse_base               (GScanner     *scanner,
-                                                   GtkStyle     *style);
+                                                   GtkRcStyle   *style);
 static guint      gtk_rc_parse_bg                 (GScanner     *scanner,
-                                                   GtkStyle     *style);
+                                                   GtkRcStyle   *style);
 static guint      gtk_rc_parse_fg                 (GScanner     *scanner,
-                                                   GtkStyle     *style);
+                                                   GtkRcStyle   *style);
 static guint      gtk_rc_parse_text               (GScanner     *scanner,
-                                                   GtkStyle     *style);
+                                                   GtkRcStyle   *style);
 static guint      gtk_rc_parse_bg_pixmap          (GScanner     *scanner,
                                                    GtkRcStyle   *rc_style);
 static guint      gtk_rc_parse_font               (GScanner     *scanner,
                                                    GtkRcStyle   *rc_style);
 static guint      gtk_rc_parse_fontset            (GScanner     *scanner,
                                                    GtkRcStyle   *rc_style);
+static guint      gtk_rc_parse_engine             (GScanner     *scanner,
+                                                   GtkRcStyle   *rc_style);
 static guint      gtk_rc_parse_pixmap_path        (GScanner     *scanner);
 static void       gtk_rc_parse_pixmap_path_string (gchar *pix_path);
-static char*      gtk_rc_find_pixmap_in_path      (GScanner     *scanner,
-                                                   gchar *pixmap_file);
+static guint      gtk_rc_parse_module_path        (GScanner     *scanner);
+static void       gtk_rc_parse_module_path_string (gchar *mod_path);
 static guint      gtk_rc_parse_path_pattern       (GScanner     *scanner);
 static void        gtk_rc_clear_hash_node          (gpointer   key, 
                                                    gpointer   data, 
                                                    gpointer   user_data);
-static void        gtk_rc_clear_styles             (void);
-
+static void        gtk_rc_clear_styles               (void);
+static void        gtk_rc_append_default_pixmap_path (void);
+static void        gtk_rc_append_default_module_path (void);
+static void        gtk_rc_append_pixmap_path         (gchar *dir);
 
 
 static GScannerConfig  gtk_rc_scanner_config =
@@ -177,28 +168,150 @@ static struct
   { "application", GTK_RC_TOKEN_APPLICATION },
   { "rc", GTK_RC_TOKEN_RC },
   { "highest", GTK_RC_TOKEN_HIGHEST },
+  { "engine", GTK_RC_TOKEN_ENGINE },
+  { "module_path", GTK_RC_TOKEN_MODULE_PATH },
 };
 
 static guint n_symbols = sizeof (symbols) / sizeof (symbols[0]);
 
 static GHashTable *rc_style_ht = NULL;
+static GHashTable *realized_style_ht = NULL;
 static GSList *gtk_rc_sets_widget = NULL;
 static GSList *gtk_rc_sets_widget_class = NULL;
 static GSList *gtk_rc_sets_class = NULL;
 
 #define GTK_RC_MAX_PIXMAP_PATHS 128
 static gchar *pixmap_path[GTK_RC_MAX_PIXMAP_PATHS];
+#define GTK_RC_MAX_MODULE_PATHS 128
+static gchar *module_path[GTK_RC_MAX_MODULE_PATHS];
 
 /* The files we have parsed, to reread later if necessary */
 GSList *rc_files = NULL;
 
 static GtkImageLoader image_loader = NULL;
 
+/* RC file handling */
+
+
+gchar *
+gtk_rc_get_theme_dir(void)
+{
+  gchar *var, *path;
+
+  var = getenv("GTK_DATA_PREFIX");
+  if (var)
+    {
+      path = g_malloc(strlen(var) + strlen("/share/themes") +1);
+      sprintf(path, "%s%s", var, "/share/themes");
+    }
+  else
+    {
+      path = g_malloc(strlen(GTK_DATA_PREFIX) + strlen("/share/themes") +1);
+      sprintf(path, "%s%s", GTK_DATA_PREFIX, "/share/themes");
+    }
+  return path;
+}
+
+gchar *
+gtk_rc_get_module_dir(void)
+{
+  gchar *var, *path;
+
+  var = getenv("GTK_EXE_PREFIX");
+  if (var)
+    {
+      path = g_malloc(strlen(var) + strlen("/lib/gtk/themes/engines") +1);
+      sprintf(path, "%s%s", var, "/lib/gtk/themes/engines");
+    }
+  else
+    {
+      path = g_malloc(strlen(GTK_EXE_PREFIX) + strlen("/lib/gtk/themes/engines") +1);
+      sprintf(path, "%s%s", GTK_EXE_PREFIX, "/lib/gtk/themes/engines");
+    }
+  return path;
+}
+
+static void
+gtk_rc_append_default_pixmap_path(void)
+{
+  gchar *var, *path;
+  gint n;
+
+  var = getenv("GTK_DATA_PREFIX");
+  if (var)
+    {
+      path = g_malloc(strlen(var) + strlen("/share/gtk/themes") +1);
+      sprintf(path, "%s%s", var, "/share/gtk/themes");
+    }
+  else
+    {
+      path = g_malloc(strlen(GTK_DATA_PREFIX) + strlen("/share/gtk/themes") +1);
+      sprintf(path, "%s%s", GTK_DATA_PREFIX, "/share/gtk/themes");
+    }
+  
+  for (n = 0; pixmap_path[n]; n++) ;
+  if (n >= GTK_RC_MAX_PIXMAP_PATHS - 1)
+    return;
+  pixmap_path[n++] = g_strdup(path);
+  pixmap_path[n] = NULL;
+  g_free(path);
+}
+
+static void
+gtk_rc_append_pixmap_path(gchar *dir)
+{
+  gint n;
+
+  for (n = 0; pixmap_path[n]; n++) ;
+  if (n >= GTK_RC_MAX_MODULE_PATHS - 1)
+    return;
+  pixmap_path[n++] = g_strdup(dir);
+  pixmap_path[n] = NULL;
+}
+
+static void
+gtk_rc_append_default_module_path(void)
+{
+  gchar *var, *path;
+  gint n;
+
+  for (n = 0; module_path[n]; n++) ;
+  if (n >= GTK_RC_MAX_MODULE_PATHS - 1)
+    return;
+  
+  var = getenv("GTK_EXE_PREFIX");
+  if (var)
+    {
+      path = g_malloc(strlen(var) + strlen("/lib/gtk/themes/engines") +1);
+      sprintf(path, "%s%s", var, "/lib/gtk/themes/engines");
+    }
+  else
+    {
+      path = g_malloc(strlen(GTK_EXE_PREFIX) + strlen("/lib/gtk/themes/engines") +1);
+      sprintf(path, "%s%s", GTK_EXE_PREFIX, "/lib/gtk/themes/engines");
+    }
+  module_path[n++] = g_strdup(path);
+  g_free(path);
+  var = getenv("HOME");
+  if (var)
+    {
+      path = g_malloc(strlen(var) + strlen(".gtk/lib/themes/engines") +1);
+      sprintf(path, "%s%s", var, ".gtk/lib/themes/engines");
+    }
+  module_path[n++] = g_strdup(path);
+  module_path[n] = NULL;
+  g_free(path);
+}
+
 void
 gtk_rc_init (void)
 {
   rc_style_ht = g_hash_table_new ((GHashFunc) gtk_rc_style_hash,
                                  (GCompareFunc) gtk_rc_style_compare);
+  pixmap_path[0] = NULL;
+  module_path[0] = NULL;
+  gtk_rc_append_default_pixmap_path();
+  gtk_rc_append_default_module_path();
 }
 
 void
@@ -272,6 +385,16 @@ gtk_rc_parse_file (const gchar *filename, gboolean reload)
       if (fd < 0)
        return;
 
+       {
+         gint i;
+         gchar *dir;
+         
+         dir = g_strdup(rc_file->canonical_name);
+         for (i = strlen(dir) - 1; (i >= 0) && (dir[i] != '/'); i--)
+           dir[i] = 0;
+         gtk_rc_append_pixmap_path(dir);
+         g_free(dir);
+       }
       gtk_rc_parse_any (filename, fd, NULL);
 
       close (fd);
@@ -286,37 +409,73 @@ gtk_rc_parse (const gchar *filename)
   gtk_rc_parse_file (filename, TRUE);
 }
 
-static void
-gtk_rc_clear_hash_node (gpointer key, 
-                       gpointer data, 
-                       gpointer user_data)
+/* Handling of RC styles */
+
+GtkRcStyle *
+gtk_rc_style_new              (void)
 {
-  int i;
-  GtkRcStyle *rc_style = data;
-  GList *tmp_list;
+  GtkRcStyle *new_style;
 
-  g_free (rc_style->name);
-  g_free (rc_style->font_name);
-  g_free (rc_style->fontset_name);
+  new_style = g_new0 (GtkRcStyle, 1);
+  new_style->ref_count = 1;
 
-  for (i=0 ; i<5 ; i++)
-    g_free (rc_style->bg_pixmap_name[i]);
+  return new_style;
+}
 
-  gtk_style_unref (rc_style->proto_style);
+void      
+gtk_rc_style_ref (GtkRcStyle  *rc_style)
+{
+  g_return_if_fail (rc_style != NULL);
 
-  tmp_list = rc_style->styles;
-  while (tmp_list)
-    {
-      GtkRcNode *node = tmp_list->data;
+  rc_style->ref_count++;
+}
 
-      gdk_colormap_unref (node->cmap);
-      gtk_style_unref (node->style);
+void      
+gtk_rc_style_unref (GtkRcStyle  *rc_style)
+{
+  gint i;
 
-      g_free (node);
-      tmp_list = tmp_list->next;
+  g_return_if_fail (rc_style != NULL);
+
+  rc_style->ref_count--;
+
+  if (rc_style->ref_count == 0)
+    {
+      if (rc_style->engine)
+       {
+         rc_style->engine->destroy_rc_style (rc_style);
+         gtk_theme_engine_unref (rc_style->engine);
+       }
+
+      if (rc_style->name)
+       g_free (rc_style->name);
+      if (rc_style->fontset_name)
+       g_free (rc_style->fontset_name);
+      if (rc_style->font_name)
+       g_free (rc_style->font_name);
+      
+      for (i=0 ; i<5 ; i++)
+       if (rc_style->bg_pixmap_name[i])
+         g_free (rc_style->bg_pixmap_name[i]);
+      
+      g_free (rc_style);
     }
+}
 
-  g_free (rc_style);
+static void
+gtk_rc_clear_realized_node (gpointer key,
+                           gpointer data,
+                           gpointer user_data)
+{
+  gtk_style_unref (data);
+}
+
+static void
+gtk_rc_clear_hash_node (gpointer key, 
+                       gpointer data, 
+                       gpointer user_data)
+{
+  gtk_rc_style_unref (data);
 }
 
 static void
@@ -339,9 +498,19 @@ gtk_rc_clear_styles (void)
 {
   /* Clear out all old rc_styles */
 
-  g_hash_table_foreach (rc_style_ht, gtk_rc_clear_hash_node, NULL);
-  g_hash_table_destroy (rc_style_ht);
-  rc_style_ht = NULL;
+  if (rc_style_ht)
+    {
+      g_hash_table_foreach (rc_style_ht, gtk_rc_clear_hash_node, NULL);
+      g_hash_table_destroy (rc_style_ht);
+      rc_style_ht = NULL;
+    }
+
+  if (realized_style_ht)
+    {
+      g_hash_table_foreach (realized_style_ht, gtk_rc_clear_realized_node, NULL);
+      g_hash_table_destroy (realized_style_ht);
+      realized_style_ht = NULL;
+    }
 
   gtk_rc_free_rc_sets (gtk_rc_sets_widget);
   g_slist_free (gtk_rc_sets_widget);
@@ -403,11 +572,13 @@ gtk_rc_reparse_all (void)
   return mtime_modified;
 }
 
-static GtkRcStyle*
-gtk_rc_styles_match (GSList      *sets,
+static GSList *
+gtk_rc_styles_match (GSList       *rc_styles,
+                    GSList       *sets,
                     guint         path_length,
                     gchar        *path,
                     gchar        *path_reversed)
+                    
 {
   GtkRcSet *rc_set;
 
@@ -417,16 +588,31 @@ gtk_rc_styles_match (GSList         *sets,
       sets = sets->next;
 
       if (gtk_pattern_match (&rc_set->pspec, path_length, path, path_reversed))
-       return rc_set->rc_style;
+       rc_styles = g_slist_append (rc_styles, rc_set->rc_style);
     }
   
-  return NULL;
+  return rc_styles;
 }
 
 GtkStyle*
 gtk_rc_get_style (GtkWidget *widget)
 {
-  GtkRcStyle *rc_style;
+  GtkRcStyle *widget_rc_style;
+  GSList *rc_styles = NULL;
+
+  static guint rc_style_key_id = 0;
+
+  /* We allow the specification of a single rc style to be bound
+   * tightly to a widget, for application modifications
+   */
+  if (!rc_style_key_id)
+    rc_style_key_id = g_quark_from_static_string ("gtk-rc-style");
+
+  widget_rc_style = gtk_object_get_data_by_id (GTK_OBJECT (widget),
+                                              rc_style_key_id);
+
+  if (widget_rc_style)
+    rc_styles = g_list_prepend (rc_styles, widget_rc_style);
   
   if (gtk_rc_sets_widget)
     {
@@ -434,12 +620,10 @@ gtk_rc_get_style (GtkWidget *widget)
       guint path_length;
 
       gtk_widget_path (widget, &path_length, &path, &path_reversed);
-      rc_style = gtk_rc_styles_match (gtk_rc_sets_widget, path_length, path, path_reversed);
+      rc_styles = gtk_rc_styles_match (rc_styles, gtk_rc_sets_widget, path_length, path, path_reversed);
       g_free (path);
       g_free (path_reversed);
       
-      if (rc_style)
-       return gtk_rc_style_init (rc_style, gtk_widget_get_colormap (widget));
     }
   
   if (gtk_rc_sets_widget_class)
@@ -448,12 +632,9 @@ gtk_rc_get_style (GtkWidget *widget)
       guint path_length;
 
       gtk_widget_class_path (widget, &path_length, &path, &path_reversed);
-      rc_style = gtk_rc_styles_match (gtk_rc_sets_widget_class, path_length, path, path_reversed);
+      rc_styles = gtk_rc_styles_match (rc_styles, gtk_rc_sets_widget_class, path_length, path, path_reversed);
       g_free (path);
       g_free (path_reversed);
-      
-      if (rc_style)
-       return gtk_rc_style_init (rc_style, gtk_widget_get_colormap (widget));
     }
 
   if (gtk_rc_sets_class)
@@ -471,40 +652,37 @@ gtk_rc_get_style (GtkWidget *widget)
          path_reversed = g_strdup (path);
          g_strreverse (path_reversed);
          
-         rc_style = gtk_rc_styles_match (gtk_rc_sets_class, path_length, path, path_reversed);
+         rc_styles = gtk_rc_styles_match (rc_styles, gtk_rc_sets_class, path_length, path, path_reversed);
          g_free (path_reversed);
       
-         if (rc_style)
-           return gtk_rc_style_init (rc_style, gtk_widget_get_colormap (widget));
-
          type = gtk_type_parent (type);
        }
     }
   
+  if (rc_styles)
+    return gtk_rc_style_init (rc_styles);
+
   return NULL;
 }
 
 static GSList*
 gtk_rc_add_rc_sets (GSList     *slist,
-                   GtkStyle   *style,
+                   GtkRcStyle *rc_style,
                    const char *pattern)
 {
-  GtkRcStyle *rc_style;
+  GtkRcStyle *new_style;
   GtkRcSet *rc_set;
   guint i;
   
-  gtk_style_ref (style);
-  
-  rc_style = g_new (GtkRcStyle, 1);
-  rc_style->name = NULL;
-  rc_style->font_name = NULL;
-  rc_style->fontset_name = NULL;
+  new_style = gtk_rc_style_new ();
+  *new_style = *rc_style;
+  new_style->name = g_strdup (rc_style->name);
+  new_style->font_name = g_strdup (rc_style->font_name);
+  new_style->fontset_name = g_strdup (rc_style->fontset_name);
   
   for (i = 0; i < 5; i++)
-    rc_style->bg_pixmap_name[i] = NULL;
+    new_style->bg_pixmap_name[i] = g_strdup (rc_style->bg_pixmap_name[i]);
   
-  rc_style->styles = g_list_append (NULL, style);
-
   rc_set = g_new (GtkRcSet, 1);
   gtk_pattern_spec_init (&rc_set->pspec, pattern);
   rc_set->rc_style = rc_style;
@@ -513,33 +691,33 @@ gtk_rc_add_rc_sets (GSList     *slist,
 }
 
 void
-gtk_rc_add_widget_name_style (GtkStyle           *style,
+gtk_rc_add_widget_name_style (GtkRcStyle  *rc_style,
                              const gchar *pattern)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (rc_style != NULL);
   g_return_if_fail (pattern != NULL);
 
-  gtk_rc_sets_widget = gtk_rc_add_rc_sets (gtk_rc_sets_widget, style, pattern);
+  gtk_rc_sets_widget = gtk_rc_add_rc_sets (gtk_rc_sets_widget, rc_style, pattern);
 }
 
 void
-gtk_rc_add_widget_class_style (GtkStyle    *style,
+gtk_rc_add_widget_class_style (GtkRcStyle  *rc_style,
                               const gchar *pattern)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (rc_style != NULL);
   g_return_if_fail (pattern != NULL);
 
-  gtk_rc_sets_widget_class = gtk_rc_add_rc_sets (gtk_rc_sets_widget_class, style, pattern);
+  gtk_rc_sets_widget_class = gtk_rc_add_rc_sets (gtk_rc_sets_widget_class, rc_style, pattern);
 }
 
 void
-gtk_rc_add_class_style (GtkStyle    *style,
+gtk_rc_add_class_style (GtkRcStyle  *rc_style,
                        const gchar *pattern)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (rc_style != NULL);
   g_return_if_fail (pattern != NULL);
 
-  gtk_rc_sets_class = gtk_rc_add_rc_sets (gtk_rc_sets_class, style, pattern);
+  gtk_rc_sets_class = gtk_rc_add_rc_sets (gtk_rc_sets_class, rc_style, pattern);
 }
 
 static void
@@ -631,6 +809,36 @@ gtk_rc_parse_any (const gchar  *input_name,
   g_scanner_destroy (scanner);
 }
 
+static guint      
+gtk_rc_styles_hash (const GSList *rc_styles)
+{
+  guint result;
+  
+  result = 0;
+  while (rc_styles)
+    {
+      result += (result << 9) + GPOINTER_TO_UINT (rc_styles->data);
+      rc_styles = rc_styles->next;
+    }
+  
+  return result;
+}
+
+static gint       
+gtk_rc_styles_compare (const GSList *a,
+                      const GSList *b)
+{
+  while (a && b)
+    {
+      if (a->data != b->data)
+       return FALSE;
+      a = a->next;
+      b = b->next;
+    }
+  
+  return (a == b);
+}
+
 static guint
 gtk_rc_style_hash (const char *name)
 {
@@ -660,94 +868,145 @@ gtk_rc_style_find (const char *name)
   return rc_style;
 }
 
+/* Assumes ownership of rc_style */
 static GtkStyle *
-gtk_rc_style_init (GtkRcStyle *rc_style, GdkColormap *cmap)
+gtk_rc_style_to_style (GtkRcStyle *rc_style)
 {
+  GtkStyle *style;
   GdkFont *old_font;
-  gboolean match_cmap = FALSE;
   gint i;
 
-  GList *tmp_list;
-  GtkStyle *style = NULL;
-  GtkRcNode *node;
+  style = gtk_style_new ();
 
-  tmp_list = rc_style->styles;
+  style->rc_style = rc_style;
+  
+  if (rc_style->fontset_name)
+    {
+      old_font = style->font;
+      style->font = gdk_fontset_load (rc_style->fontset_name);
+      if (style->font)
+       gdk_font_unref (old_font);
+      else
+       style->font = old_font;
+    }
+  else if (rc_style->font_name)
+    {
+      old_font = style->font;
+      style->font = gdk_font_load (rc_style->font_name);
+      if (style->font)
+       gdk_font_unref (old_font);
+      else
+       style->font = old_font;
+    }
+  
+  for (i = 0; i < 5; i++)
+    {
+      if (rc_style->color_flags[i] & GTK_RC_FG)
+       style->fg[i] = rc_style->fg[i];
+      if (rc_style->color_flags[i] & GTK_RC_BG)
+       style->bg[i] = rc_style->bg[i];
+      if (rc_style->color_flags[i] & GTK_RC_TEXT)
+       style->text[i] = rc_style->text[i];
+      if (rc_style->color_flags[i] & GTK_RC_BASE)
+       style->base[i] = rc_style->base[i];
+    }
 
-  for (i=0; i<5; i++)
-    if (rc_style->bg_pixmap_name[i])
-      match_cmap = TRUE;
-      
-  while (tmp_list)
+  if (rc_style->engine)
     {
-      node = (GtkRcNode *)tmp_list->data;
+      style->engine = rc_style->engine;
+      gtk_theme_engine_ref (style->engine);
+      rc_style->engine->rc_style_to_style (style, rc_style);
+    }
 
-      if (!match_cmap || (node->cmap == cmap))
-       {
-         style = node->style;
-         break;
-       }
+  return style;
+}
+
+/* Reuses or frees rc_styles */
+static GtkStyle *
+gtk_rc_style_init (GSList *rc_styles)
+{
+  gint i;
+
+  GtkStyle *style = NULL;
+  GtkRcStyle *proto_style;
+
+  if (!realized_style_ht)
+    realized_style_ht = g_hash_table_new ((GHashFunc)gtk_rc_styles_hash,
+                                          (GCompareFunc)gtk_rc_styles_compare);
+
+  style = g_hash_table_lookup (realized_style_ht, rc_styles);
 
-      tmp_list = tmp_list->next;
-    }
-  
   if (!style)
     {
-      node = g_new (GtkRcNode, 1);
-      style = gtk_style_copy (rc_style->proto_style);
-
-     /* FIXME, this leaks colormaps, but if we don't do this, then we'll
-       * be screwed, because we identify colormaps by address equality
-       */
-      gdk_colormap_ref (cmap);
-      node->style = style;
-      node->cmap = cmap;
+      GSList *tmp_styles = rc_styles;
       
-      if (rc_style->fontset_name)
-       {
-         old_font = style->font;
-         style->font = gdk_fontset_load (rc_style->fontset_name);
-         if (style->font)
-           gdk_font_unref (old_font);
-         else
-           style->font = old_font;
-       }
-      else if (rc_style->font_name)
+      proto_style = gtk_rc_style_new ();
+
+      while (tmp_styles)
        {
-         old_font = style->font;
-         style->font = gdk_font_load (rc_style->font_name);
-         if (style->font)
-           gdk_font_unref (old_font);
-         else
-           style->font = old_font;
+         GtkRcStyle *rc_style = tmp_styles->data;
+
+         for (i=0; i<5; i++)
+           {
+             if (!proto_style->bg_pixmap_name[i] && rc_style->bg_pixmap_name[i])
+               proto_style->bg_pixmap_name[i] = g_strdup (rc_style->bg_pixmap_name[i]);
+
+             if (!(proto_style->color_flags[i] & GTK_RC_FG) && 
+                   rc_style->color_flags[i] & GTK_RC_FG)
+               {
+                 proto_style->fg[i] = rc_style->fg[i];
+                 proto_style->color_flags[i] |= GTK_RC_FG;
+               }
+             if (!(proto_style->color_flags[i] & GTK_RC_BG) && 
+                   rc_style->color_flags[i] & GTK_RC_BG)
+               {
+                 proto_style->bg[i] = rc_style->bg[i];
+                 proto_style->color_flags[i] |= GTK_RC_BG;
+               }
+             if (!(proto_style->color_flags[i] & GTK_RC_TEXT) && 
+                   rc_style->color_flags[i] & GTK_RC_TEXT)
+               {
+                 proto_style->text[i] = rc_style->text[i];
+                 proto_style->color_flags[i] |= GTK_RC_TEXT;
+               }
+             if (!(proto_style->color_flags[i] & GTK_RC_BASE) && 
+                   rc_style->color_flags[i] & GTK_RC_BASE)
+               {
+                 proto_style->base[i] = rc_style->base[i];
+                 proto_style->color_flags[i] |= GTK_RC_BASE;
+               }
+           }
+
+         if (!proto_style->font_name && rc_style->font_name)
+           proto_style->font_name = g_strdup (rc_style->font_name);
+         if (!proto_style->fontset_name && rc_style->fontset_name)
+           proto_style->fontset_name = g_strdup (rc_style->fontset_name);
+
+         if (!proto_style->engine && rc_style->engine)
+           {
+             proto_style->engine = rc_style->engine;
+             gtk_theme_engine_ref (proto_style->engine);
+           }
+         
+         if (proto_style->engine &&
+             (proto_style->engine == rc_style->engine))
+           proto_style->engine->merge_rc_style (proto_style, rc_style);
+
+         tmp_styles = tmp_styles->next;
        }
-      
-      for (i = 0; i < 5; i++)
-       if (rc_style->bg_pixmap_name[i])
-         {
-           if (strcmp (rc_style->bg_pixmap_name[i], "<parent>") == 0)
-             style->bg_pixmap[i] = (GdkPixmap*) GDK_PARENT_RELATIVE;
-           else
-             {
-               if(image_loader)
-                 style->bg_pixmap[i] = image_loader(NULL, cmap, NULL,
-                                                    &style->bg[i],
-                                                    rc_style->bg_pixmap_name[i]);
-               else
-                 style->bg_pixmap[i] = 
-                   gdk_pixmap_colormap_create_from_xpm (NULL, cmap,
-                                                        NULL,
-                                                        &style->bg[i],
-                                                        rc_style->bg_pixmap_name[i]);
-             }
-         }
-
-      rc_style->styles = g_list_append (rc_style->styles, node);
+
+      style = gtk_rc_style_to_style (proto_style);
+
+      g_hash_table_insert (realized_style_ht, rc_styles, style);
     }
 
   return style;
 }
 
+/*********************
+ * Parsing functions *
+ *********************/
+
 static guint
 gtk_rc_parse_statement (GScanner *scanner)
 {
@@ -787,6 +1046,9 @@ gtk_rc_parse_statement (GScanner *scanner)
     case GTK_RC_TOKEN_CLASS:
       return gtk_rc_parse_path_pattern (scanner);
 
+    case GTK_RC_TOKEN_MODULE_PATH:
+      return gtk_rc_parse_module_path (scanner);
+       
     default:
       g_scanner_get_next_token (scanner);
       return /* G_TOKEN_SYMBOL */ GTK_RC_TOKEN_STYLE;
@@ -816,16 +1078,17 @@ gtk_rc_parse_style (GScanner *scanner)
   if (!rc_style)
     {
       insert = TRUE;
-      rc_style = g_new (GtkRcStyle, 1);
+      rc_style = gtk_rc_style_new ();
       rc_style->name = g_strdup (scanner->value.v_string);
-      rc_style->font_name = NULL;
-      rc_style->fontset_name = NULL;
       
       for (i = 0; i < 5; i++)
        rc_style->bg_pixmap_name[i] = NULL;
 
-      rc_style->proto_style = gtk_style_new();
-      rc_style->styles = NULL;
+      for (i = 0; i < 5; i++)
+       rc_style->color_flags[i] = 0;
+
+      rc_style->engine = NULL;
+      rc_style->engine_data = NULL;
     }
   
   token = g_scanner_peek_next_token (scanner);
@@ -837,10 +1100,8 @@ gtk_rc_parse_style (GScanner *scanner)
       if (token != G_TOKEN_STRING)
        {
          if (insert)
-           {
-             gtk_style_unref (rc_style->proto_style);
-             g_free (rc_style);
-           }
+           g_free (rc_style);
+
          return G_TOKEN_STRING;
        }
       
@@ -849,18 +1110,13 @@ gtk_rc_parse_style (GScanner *scanner)
        {
          for (i = 0; i < 5; i++)
            {
-             rc_style->proto_style->fg[i] = parent_style->proto_style->fg[i];
-             rc_style->proto_style->bg[i] = parent_style->proto_style->bg[i];
-             rc_style->proto_style->light[i] = parent_style->proto_style->light[i];
-             rc_style->proto_style->dark[i] = parent_style->proto_style->dark[i];
-             rc_style->proto_style->mid[i] = parent_style->proto_style->mid[i];
-             rc_style->proto_style->text[i] = parent_style->proto_style->text[i];
-             rc_style->proto_style->base[i] = parent_style->proto_style->base[i];
+             rc_style->color_flags[i] = parent_style->color_flags[i];
+             rc_style->fg[i] = parent_style->fg[i];
+             rc_style->bg[i] = parent_style->bg[i];
+             rc_style->text[i] = parent_style->text[i];
+             rc_style->base[i] = parent_style->base[i];
            }
          
-         rc_style->proto_style->black = parent_style->proto_style->black;
-         rc_style->proto_style->white = parent_style->proto_style->white;
-         
          if (rc_style->fontset_name)
            {
              g_free (rc_style->fontset_name);
@@ -885,10 +1141,8 @@ gtk_rc_parse_style (GScanner *scanner)
   if (token != G_TOKEN_LEFT_CURLY)
     {
       if (insert)
-       {
-         gtk_style_unref (rc_style->proto_style);
-         g_free (rc_style);
-       }
+       g_free (rc_style);
+
       return G_TOKEN_LEFT_CURLY;
     }
   
@@ -898,16 +1152,16 @@ gtk_rc_parse_style (GScanner *scanner)
       switch (token)
        {
        case GTK_RC_TOKEN_BASE:
-         token = gtk_rc_parse_base (scanner, rc_style->proto_style);
+         token = gtk_rc_parse_base (scanner, rc_style);
          break;
        case GTK_RC_TOKEN_BG:
-         token = gtk_rc_parse_bg (scanner, rc_style->proto_style);
+         token = gtk_rc_parse_bg (scanner, rc_style);
          break;
        case GTK_RC_TOKEN_FG:
-         token = gtk_rc_parse_fg (scanner, rc_style->proto_style);
+         token = gtk_rc_parse_fg (scanner, rc_style);
          break;
        case GTK_RC_TOKEN_TEXT:
-         token = gtk_rc_parse_text (scanner, rc_style->proto_style);
+         token = gtk_rc_parse_text (scanner, rc_style);
          break;
        case GTK_RC_TOKEN_BG_PIXMAP:
          token = gtk_rc_parse_bg_pixmap (scanner, rc_style);
@@ -918,6 +1172,9 @@ gtk_rc_parse_style (GScanner *scanner)
        case GTK_RC_TOKEN_FONTSET:
          token = gtk_rc_parse_fontset (scanner, rc_style);
          break;
+       case GTK_RC_TOKEN_ENGINE:
+         token = gtk_rc_parse_engine (scanner, rc_style);
+         break;
        default:
          g_scanner_get_next_token (scanner);
          token = G_TOKEN_RIGHT_CURLY;
@@ -935,7 +1192,6 @@ gtk_rc_parse_style (GScanner *scanner)
              for (i = 0; i < 5; i++)
                if (rc_style->bg_pixmap_name[i])
                  g_free (rc_style->bg_pixmap_name[i]);
-             gtk_style_unref (rc_style->proto_style);
              g_free (rc_style);
            }
          return token;
@@ -957,7 +1213,6 @@ gtk_rc_parse_style (GScanner *scanner)
            if (rc_style->bg_pixmap_name[i])
              g_free (rc_style->bg_pixmap_name[i]);
          
-         gtk_style_unref (rc_style->proto_style);
          g_free (rc_style);
        }
       return G_TOKEN_RIGHT_CURLY;
@@ -970,8 +1225,8 @@ gtk_rc_parse_style (GScanner *scanner)
 }
 
 static guint
-gtk_rc_parse_base (GScanner *scanner,
-                  GtkStyle *style)
+gtk_rc_parse_base (GScanner   *scanner,
+                  GtkRcStyle *style)
 {
   GtkStateType state;
   guint token;
@@ -987,13 +1242,14 @@ gtk_rc_parse_base (GScanner *scanner,
   token = g_scanner_get_next_token (scanner);
   if (token != G_TOKEN_EQUAL_SIGN)
     return G_TOKEN_EQUAL_SIGN;
-  
+
+  style->color_flags[state] |= GTK_RC_BASE;
   return gtk_rc_parse_color (scanner, &style->base[state]);
 }
 
 static guint
-gtk_rc_parse_bg (GScanner *scanner,
-                GtkStyle *style)
+gtk_rc_parse_bg (GScanner   *scanner,
+                GtkRcStyle *style)
 {
   GtkStateType state;
   guint token;
@@ -1009,13 +1265,14 @@ gtk_rc_parse_bg (GScanner *scanner,
   token = g_scanner_get_next_token (scanner);
   if (token != G_TOKEN_EQUAL_SIGN)
     return G_TOKEN_EQUAL_SIGN;
-  
+
+  style->color_flags[state] |= GTK_RC_BG;
   return gtk_rc_parse_color (scanner, &style->bg[state]);
 }
 
 static guint
-gtk_rc_parse_fg (GScanner *scanner,
-                GtkStyle *style)
+gtk_rc_parse_fg (GScanner   *scanner,
+                GtkRcStyle *style)
 {
   GtkStateType state;
   guint token;
@@ -1032,12 +1289,13 @@ gtk_rc_parse_fg (GScanner *scanner,
   if (token != G_TOKEN_EQUAL_SIGN)
     return G_TOKEN_EQUAL_SIGN;
   
+  style->color_flags[state] |= GTK_RC_FG;
   return gtk_rc_parse_color (scanner, &style->fg[state]);
 }
 
 static guint
-gtk_rc_parse_text (GScanner *scanner,
-                  GtkStyle *style)
+gtk_rc_parse_text (GScanner   *scanner,
+                  GtkRcStyle *style)
 {
   GtkStateType state;
   guint token;
@@ -1054,6 +1312,7 @@ gtk_rc_parse_text (GScanner *scanner,
   if (token != G_TOKEN_EQUAL_SIGN)
     return G_TOKEN_EQUAL_SIGN;
   
+  style->color_flags[state] |= GTK_RC_TEXT;
   return gtk_rc_parse_color (scanner, &style->text[state]);
 }
 
@@ -1096,7 +1355,7 @@ gtk_rc_parse_bg_pixmap (GScanner   *scanner,
   return G_TOKEN_NONE;
 }
 
-static gchar*
+gchar*
 gtk_rc_find_pixmap_in_path (GScanner *scanner,
                            gchar    *pixmap_file)
 {
@@ -1118,10 +1377,47 @@ gtk_rc_find_pixmap_in_path (GScanner *scanner,
       
       g_free (buf);
     }
+
+  if (scanner)
+    g_warning ("Unable to locate image file in pixmap_path: \"%s\" line %d",
+              pixmap_file, scanner->line);
+  else
+    g_warning ("Unable to locate image file in pixmap_path: \"%s\"",
+              pixmap_file);
+    
+  return NULL;
+}
+
+gchar*
+gtk_rc_find_module_in_path (GScanner *scanner,
+                           gchar    *module_file)
+{
+  gint i;
+  gint fd;
+  gchar *buf;
   
-  g_warning ("Unable to locate image file in pixmap_path: \"%s\" line %d",
-            pixmap_file, scanner->line);
+  for (i = 0; (i < GTK_RC_MAX_MODULE_PATHS) && (module_path[i] != NULL); i++)
+    {
+      buf = g_malloc (strlen (module_path[i]) + strlen (module_file) + 2);
+      sprintf (buf, "%s%c%s", module_path[i], '/', module_file);
+      
+      fd = open (buf, O_RDONLY);
+      if (fd >= 0)
+       {
+         close (fd);
+         return buf;
+       }
+      
+      g_free (buf);
+    }
   
+  if (scanner)
+    g_warning ("Unable to locate loadable module in module_path: \"%s\" line %d",
+              module_file, scanner->line);
+  else
+    g_warning ("Unable to locate loadable module in module_path: \"%s\",",
+              module_file);
+    
   return NULL;
 }
 
@@ -1175,6 +1471,48 @@ gtk_rc_parse_fontset (GScanner    *scanner,
   return G_TOKEN_NONE;
 }
 
+static guint      
+gtk_rc_parse_engine (GScanner   *scanner,
+                    GtkRcStyle  *rc_style)
+{
+  guint token;
+
+  token = g_scanner_get_next_token (scanner);
+  if (token != GTK_RC_TOKEN_ENGINE)
+    return GTK_RC_TOKEN_ENGINE;
+
+  token = g_scanner_get_next_token (scanner);
+  if (token != G_TOKEN_STRING)
+    return G_TOKEN_STRING;
+
+  rc_style->engine = gtk_theme_engine_get (scanner->value.v_string);
+
+  token = g_scanner_get_next_token (scanner);
+  if (token != G_TOKEN_LEFT_CURLY)
+    return G_TOKEN_LEFT_CURLY;
+
+  if (rc_style->engine)
+    return rc_style->engine->parse_rc_style (scanner, rc_style);
+  else
+    {
+      /* Skip over remainder, looking for nested {}'s */
+      guint count = 1;
+      
+      while ((token = g_scanner_get_next_token (scanner)) != G_TOKEN_EOF)
+       {
+         if (token == G_TOKEN_LEFT_CURLY)
+           count++;
+         else if (token == G_TOKEN_RIGHT_CURLY)
+           count--;
+
+         if (count == 0)
+           return G_TOKEN_NONE;
+       }
+
+      return G_TOKEN_RIGHT_CURLY;
+    }
+}
+
 guint
 gtk_rc_parse_state (GScanner    *scanner,
                    GtkStateType *state)
@@ -1443,6 +1781,63 @@ gtk_rc_parse_pixmap_path_string (gchar *pix_path)
        }
     }
   g_free (buf);
+  gtk_rc_append_default_pixmap_path();
+}
+
+static guint
+gtk_rc_parse_module_path (GScanner *scanner)
+{
+  guint token;
+  
+  token = g_scanner_get_next_token (scanner);
+  if (token != GTK_RC_TOKEN_MODULE_PATH)
+    return GTK_RC_TOKEN_MODULE_PATH;
+  
+  token = g_scanner_get_next_token (scanner);
+  if (token != G_TOKEN_STRING)
+    return G_TOKEN_STRING;
+  
+  gtk_rc_parse_module_path_string (scanner->value.v_string);
+  
+  return G_TOKEN_NONE;
+}
+
+static void
+gtk_rc_parse_module_path_string (gchar *mod_path)
+{
+  gchar *buf;
+  gint end_offset;
+  gint start_offset = 0;
+  gint path_len;
+  gint path_num;
+  
+  /* free the old one, or just add to the old one ? */
+  for (path_num=0; module_path[path_num]; path_num++)
+    {
+      g_free (module_path[path_num]);
+      module_path[path_num] = NULL;
+    }
+  
+  path_num = 0;
+  
+  path_len = strlen (mod_path);
+  
+  buf = g_strdup (mod_path);
+  
+  for (end_offset = 0; end_offset <= path_len; end_offset++)
+    {
+      if ((buf[end_offset] == ':') ||
+         (end_offset == path_len))
+       {
+         buf[end_offset] = '\0';
+         module_path[path_num] = g_strdup (buf + start_offset);
+         path_num++;
+         module_path[path_num] = NULL;
+         start_offset = end_offset + 1;
+       }
+    }
+  g_free (buf);
+  gtk_rc_append_default_module_path();
 }
 
 static guint
@@ -1557,6 +1952,25 @@ typedef  GdkPixmap * (*GtkImageLoader) (GdkWindow   *window,
 void
 gtk_rc_set_image_loader(GtkImageLoader loader)
 {
-       image_loader = loader;
+  image_loader = loader;
 }
 
+GdkPixmap *
+gtk_rc_load_image (GdkColormap *colormap,
+                  GdkColor    *transparent_color,
+                  const gchar *filename)
+{
+  if (strcmp (filename, "<parent>") == 0)
+    return (GdkPixmap*) GDK_PARENT_RELATIVE;
+  else
+    {
+      if(image_loader)
+       return image_loader(NULL, colormap, NULL,
+                           transparent_color,
+                           filename);
+      else
+       return gdk_pixmap_colormap_create_from_xpm (NULL, colormap, NULL,
+                                                   transparent_color,
+                                                   filename);
+    }
+}
index 39bb324f08613945bf4578b638ec0c71f1de9c8f..8600f2138e2d04ae72d16879d7a505f2d294ea3b 100644 (file)
 #include <gtk/gtkstyle.h>
 #include <gtk/gtkwidget.h>
 
-
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
 
+typedef enum {
+  GTK_RC_FG   = 1 << 0,
+  GTK_RC_BG   = 1 << 1,
+  GTK_RC_TEXT = 1 << 2,
+  GTK_RC_BASE = 1 << 3
+} GtkRcFlags;
+
+struct _GtkRcStyle
+{
+  char *name;
+  char *font_name;
+  char *fontset_name;
+  char *bg_pixmap_name[5];
+
+  GtkRcFlags color_flags[5];
+  GdkColor   fg[5];
+  GdkColor   bg[5];
+  GdkColor   text[5];
+  GdkColor   base[5];
+
+  GtkThemeEngine *engine;
+  gpointer        engine_data;
+
+  /* Private */
+  guint ref_count;
+};
 
 void     gtk_rc_init                   (void);
 void     gtk_rc_parse                  (const gchar *filename);
 void     gtk_rc_parse_string           (const gchar *rc_string);
 gboolean  gtk_rc_reparse_all           (void);
 GtkStyle* gtk_rc_get_style             (GtkWidget   *widget);
-void     gtk_rc_add_widget_name_style  (GtkStyle    *style,
+void     gtk_rc_add_widget_name_style  (GtkRcStyle  *rc_style,
                                         const gchar *pattern);
-void     gtk_rc_add_widget_class_style (GtkStyle    *style,
+void     gtk_rc_add_widget_class_style (GtkRcStyle  *rc_style,
                                         const gchar *pattern);
-void     gtk_rc_add_class_style        (GtkStyle    *style,
+void     gtk_rc_add_class_style        (GtkRcStyle  *rc_style,
                                         const gchar *pattern);
 
-
+GtkRcStyle *gtk_rc_style_new              (void);
+void        gtk_rc_style_ref              (GtkRcStyle  *rc_style);
+void        gtk_rc_style_unref            (GtkRcStyle  *rc_style);
 
 /* Tell gtkrc to use a custom routine to load images specified in rc files instead of
  *   the default xpm-only loader
@@ -53,6 +80,15 @@ typedef       GdkPixmap * (*GtkImageLoader) (GdkWindow   *window,
                                        const gchar *filename);
 void     gtk_rc_set_image_loader(GtkImageLoader loader);
 
+GdkPixmap *gtk_rc_load_image (GdkColormap *colormap,
+                             GdkColor    *transparent_color,
+                             const gchar *filename);
+gchar      *gtk_rc_find_pixmap_in_path (GScanner *scanner,
+                                       gchar    *pixmap_file);
+gchar      *gtk_rc_find_module_in_path (GScanner *scanner,
+                                       gchar    *module_file);
+gchar      *gtk_rc_get_theme_dir(void);
+gchar      *gtk_rc_get_module_dir(void);
 
 /* private functions/definitions */
 typedef enum {
@@ -82,6 +118,8 @@ typedef enum {
   GTK_RC_TOKEN_APPLICATION,
   GTK_RC_TOKEN_RC,
   GTK_RC_TOKEN_HIGHEST,
+  GTK_RC_TOKEN_ENGINE,
+  GTK_RC_TOKEN_MODULE_PATH,
   GTK_RC_TOKEN_LAST
 } GtkRcTokenType;
 
index c43d7ed9d7d0979952d339c3cd0b415366b14872..2b25500f047d14a339ccf9a4fbd195260df13661 100644 (file)
@@ -249,26 +249,20 @@ gtk_ruler_expose (GtkWidget      *widget,
     {
       ruler = GTK_RULER (widget);
 
-      gdk_draw_rectangle (ruler->backing_store,
-                         widget->style->bg_gc[GTK_STATE_NORMAL],
-                         TRUE, 0, 0,
-                         widget->allocation.width,
-                         widget->allocation.height);
-
+      gtk_paint_box (widget->style, widget->window,
+                    GTK_STATE_NORMAL, GTK_SHADOW_OUT, 
+                    NULL, widget, "ruler",
+                    0, 0, -1, -1);
+      
       gtk_ruler_draw_ticks (ruler);
-
-      gtk_draw_shadow (widget->style, ruler->backing_store,
-                      GTK_STATE_NORMAL, GTK_SHADOW_OUT, 0, 0,
-                      widget->allocation.width,
-                      widget->allocation.height);
-
+      
       gdk_draw_pixmap (widget->window,
                       ruler->non_gr_exp_gc,
                       ruler->backing_store,
                       0, 0, 0, 0,
                       widget->allocation.width,
                       widget->allocation.height);
-
+      
       gtk_ruler_draw_pos (ruler);
     }
 
index 7592f1aecf3a139d7da747a0e96e6f7b6eae8ce7..9992160a44bb2db3d369d623f7e25b38c416fa8c 100644 (file)
@@ -26,6 +26,9 @@
 
 static void gtk_scale_class_init      (GtkScaleClass *klass);
 static void gtk_scale_init            (GtkScale      *scale);
+static void gtk_scale_map             (GtkWidget     *widget);
+static void gtk_scale_unmap           (GtkWidget     *widget);
+
 static void gtk_scale_draw_background (GtkRange      *range);
 
 
@@ -61,13 +64,18 @@ static void
 gtk_scale_class_init (GtkScaleClass *class)
 {
   GtkObjectClass *object_class;
+  GtkWidgetClass *widget_class;
   GtkRangeClass *range_class;
 
   object_class = (GtkObjectClass*) class;
   range_class = (GtkRangeClass*) class;
+  widget_class = (GtkWidgetClass*) class;
 
   parent_class = gtk_type_class (gtk_range_get_type ());
 
+  widget_class->map = gtk_scale_map;
+  widget_class->unmap = gtk_scale_unmap;
+
   range_class->draw_background = gtk_scale_draw_background;
 
   class->slider_length = 31;
@@ -79,11 +87,46 @@ static void
 gtk_scale_init (GtkScale *scale)
 {
   GTK_WIDGET_SET_FLAGS (scale, GTK_CAN_FOCUS);
+  GTK_WIDGET_SET_FLAGS (scale, GTK_NO_WINDOW);
   GTK_RANGE (scale)->digits = 1;
   scale->draw_value = TRUE;
   scale->value_pos = GTK_POS_TOP;
 }
 
+static void
+gtk_scale_map (GtkWidget *widget)
+{
+  GtkRange *range;
+
+  g_return_if_fail (widget != NULL);
+  g_return_if_fail (GTK_IS_SCALE (widget));
+
+  GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
+  range = GTK_RANGE (widget);
+
+  if (GTK_WIDGET_NO_WINDOW (widget))
+    gtk_widget_queue_draw (widget);
+
+  gdk_window_show (range->trough);
+}
+
+static void
+gtk_scale_unmap (GtkWidget *widget)
+{
+  GtkRange *range;
+
+  g_return_if_fail (widget != NULL);
+  g_return_if_fail (GTK_IS_SCALE (widget));
+
+  GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
+  range = GTK_RANGE (widget);
+
+  if (GTK_WIDGET_NO_WINDOW (widget))
+     gtk_widget_queue_clear (widget);
+
+  gdk_window_hide (range->trough);
+}
+
 void
 gtk_scale_set_digits (GtkScale *scale,
                      gint      digits)
index c4dcf5168a88e9fe88f3ba7168d13a77fe6037f9..3cb6889f313b6adb808049706f46174dd0a78c99 100644 (file)
@@ -499,15 +499,21 @@ gtk_spin_button_paint (GtkWidget    *widget,
   if (GTK_WIDGET_DRAWABLE (widget))
     {
       if (spin->shadow_type != GTK_SHADOW_NONE)
-       gtk_draw_shadow (widget->style, spin->panel,
-                        GTK_STATE_NORMAL, spin->shadow_type,
-                        0, 0, 
-                        ARROW_SIZE + 2 * widget->style->klass->xthickness,
-                        widget->requisition.height); 
-      gtk_spin_button_draw_arrow (spin, GTK_ARROW_UP);
-      gtk_spin_button_draw_arrow (spin, GTK_ARROW_DOWN);
-
-      GTK_WIDGET_CLASS (parent_class)->draw (widget, area);
+       gtk_paint_box (widget->style, spin->panel,
+                      GTK_STATE_NORMAL, spin->shadow_type,
+                      area, widget, "spinbutton",
+                      0, 0, 
+                      ARROW_SIZE + 2 * widget->style->klass->xthickness,
+                      widget->requisition.height); 
+      else
+        {
+           gdk_window_set_back_pixmap (spin->panel, NULL, TRUE);
+           gdk_window_clear_area (spin->panel, area->x, area->y, area->width, area->height);
+        }
+       gtk_spin_button_draw_arrow (spin, GTK_ARROW_UP);
+       gtk_spin_button_draw_arrow (spin, GTK_ARROW_DOWN);
+
+       GTK_WIDGET_CLASS (parent_class)->draw (widget, area);
     }
 }
 
@@ -581,10 +587,12 @@ gtk_spin_button_draw_arrow (GtkSpinButton *spin_button,
              x = widget->style->klass->xthickness - 1;
              y = widget->style->klass->ythickness - 1;
            }
-         gtk_draw_arrow (widget->style, spin_button->panel,
-                         state_type, shadow_type, arrow, TRUE, 
-                         x, y, ARROW_SIZE, widget->requisition.height / 2 
-                         - widget->style->klass->ythickness);
+         gtk_paint_arrow (widget->style, spin_button->panel,
+                          state_type, shadow_type, 
+                          NULL, widget, "spinbutton",
+                          arrow, TRUE, 
+                          x, y, ARROW_SIZE, widget->requisition.height / 2 
+                          - widget->style->klass->ythickness);
        }
       else
        {
@@ -598,10 +606,12 @@ gtk_spin_button_draw_arrow (GtkSpinButton *spin_button,
              x = widget->style->klass->xthickness - 1;
              y = widget->requisition.height / 2 + 1;
            }
-         gtk_draw_arrow (widget->style, spin_button->panel,
-                         state_type, shadow_type, arrow, TRUE, 
-                         x, y, ARROW_SIZE, widget->requisition.height / 2 
-                         - widget->style->klass->ythickness);
+         gtk_paint_arrow (widget->style, spin_button->panel,
+                          state_type, shadow_type, 
+                          NULL, widget, "spinbutton",
+                          arrow, TRUE, 
+                          x, y, ARROW_SIZE, widget->requisition.height / 2 
+                          - widget->style->klass->ythickness);
        }
     }
 }
index 98fe667589f8469af2673df182fa9cfd7edad3c2..8f4fc5f6146e5950f32b4593e6e54d0bcc6f089c 100644 (file)
  */
 #include <math.h>
 #include "gtkgc.h"
+#include "gtkrc.h"
 #include "gtkstyle.h"
+#include "gtkthemes.h"
 #include "gtkwidget.h"
+#include "gtkthemes.h"
+#include "gtkprivate.h"
+#include "gdk/gdkprivate.h"
 
 
 #define LIGHTNESS_MULT  1.3
 #define DARKNESS_MULT   0.7
 
-
-typedef struct _GtkStyleKey GtkStyleKey;
-
-struct _GtkStyleKey
-{
-  GdkColor fg[5];
-  GdkColor bg[5];
-  GdkColor text[5];
-  GdkColor base[5];
-
-  GdkPixmap *bg_pixmap[5];
-
-  GdkFont *font;
-
-  gint depth;
-  GdkColormap *colormap;
-  GtkStyleClass *klass;
-};
-
-
-static void         gtk_style_init         (GtkStyle    *style);
-static void         gtk_styles_init        (void);
-static void         gtk_style_remove       (GtkStyle    *style);
-static GtkStyle*    gtk_style_find         (GtkStyle    *style,
-                                           GdkColormap *cmap,
+static void         gtk_style_init         (GtkStyle    *style,
+                                           GdkColormap *colormap,
                                            gint         depth);
-static GtkStyle*    gtk_style_new_from_key (GtkStyleKey *key);
-static GtkStyleKey* gtk_style_key_dup      (GtkStyleKey *key);
 static void         gtk_style_destroy      (GtkStyle    *style);
-static void         gtk_style_key_destroy  (GtkStyleKey *key);
-static guint        gtk_style_key_hash     (GtkStyleKey *key);
-static guint        gtk_style_value_hash   (GtkStyle    *style);
-static gint         gtk_style_key_compare  (GtkStyleKey *a,
-                                           GtkStyleKey *b);
 
 static void gtk_default_draw_hline   (GtkStyle      *style,
                                      GdkWindow     *window,
                                      GtkStateType   state_type,
+                                     GdkRectangle  *area,
+                                     GtkWidget     *widget,
+                                     gchar         *detail,
                                      gint           x1,
                                      gint           x2,
                                      gint           y);
 static void gtk_default_draw_vline   (GtkStyle      *style,
                                      GdkWindow     *window,
                                      GtkStateType   state_type,
+                                     GdkRectangle  *area,
+                                     GtkWidget     *widget,
+                                     gchar         *detail,
                                      gint           y1,
                                      gint           y2,
                                      gint           x);
@@ -76,6 +57,20 @@ static void gtk_default_draw_shadow  (GtkStyle      *style,
                                      GdkWindow     *window,
                                      GtkStateType   state_type,
                                      GtkShadowType  shadow_type,
+                                     GdkRectangle  *area,
+                                     GtkWidget     *widget,
+                                     gchar         *detail,
+                                     gint           x,
+                                     gint           y,
+                                     gint           width,
+                                     gint           height);
+static void gtk_default_draw_shadow  (GtkStyle      *style,
+                                     GdkWindow     *window,
+                                     GtkStateType   state_type,
+                                     GtkShadowType  shadow_type,
+                                     GdkRectangle  *area,
+                                     GtkWidget     *widget,
+                                     gchar         *detail,
                                      gint           x,
                                      gint           y,
                                      gint           width,
@@ -84,15 +79,21 @@ static void gtk_default_draw_polygon (GtkStyle      *style,
                                      GdkWindow     *window,
                                      GtkStateType   state_type,
                                      GtkShadowType  shadow_type,
+                                     GdkRectangle  *area,
+                                     GtkWidget     *widget,
+                                     gchar         *detail,
                                      GdkPoint      *points,
                                      gint           npoints,
-                                     gint           fill);
+                                     gboolean       fill);
 static void gtk_default_draw_arrow   (GtkStyle      *style,
                                      GdkWindow     *window,
                                      GtkStateType   state_type,
                                      GtkShadowType  shadow_type,
+                                     GdkRectangle  *area,
+                                     GtkWidget     *widget,
+                                     gchar         *detail,
                                      GtkArrowType   arrow_type,
-                                     gint           fill,
+                                     gboolean       fill,
                                      gint           x,
                                      gint           y,
                                      gint           width,
@@ -101,6 +102,9 @@ static void gtk_default_draw_diamond (GtkStyle      *style,
                                      GdkWindow     *window,
                                      GtkStateType   state_type,
                                      GtkShadowType  shadow_type,
+                                     GdkRectangle  *area,
+                                     GtkWidget     *widget,
+                                     gchar         *detail,
                                      gint           x,
                                      gint           y,
                                      gint           width,
@@ -109,6 +113,9 @@ static void gtk_default_draw_oval    (GtkStyle      *style,
                                      GdkWindow     *window,
                                      GtkStateType   state_type,
                                      GtkShadowType  shadow_type,
+                                     GdkRectangle  *area,
+                                     GtkWidget     *widget,
+                                     gchar         *detail,
                                      gint           x,
                                      gint           y,
                                      gint           width,
@@ -116,28 +123,200 @@ static void gtk_default_draw_oval    (GtkStyle      *style,
 static void gtk_default_draw_string  (GtkStyle      *style,
                                      GdkWindow     *window,
                                      GtkStateType   state_type,
+                                     GdkRectangle  *area,
+                                     GtkWidget     *widget,
+                                     gchar         *detail,
                                      gint           x,
                                      gint           y,
                                      const gchar   *string);
+static void gtk_default_draw_box     (GtkStyle      *style,
+                                     GdkWindow     *window,
+                                     GtkStateType   state_type,
+                                     GtkShadowType  shadow_type,
+                                     GdkRectangle  *area,
+                                     GtkWidget     *widget,
+                                     gchar         *detail,
+                                     gint           x,
+                                     gint           y,
+                                     gint           width,
+                                     gint           height);
+static void gtk_default_draw_flat_box (GtkStyle      *style,
+                                      GdkWindow     *window,
+                                      GtkStateType   state_type,
+                                      GtkShadowType  shadow_type,
+                                      GdkRectangle  *area,
+                                      GtkWidget     *widget,
+                                      gchar         *detail,
+                                      gint           x,
+                                      gint           y,
+                                      gint           width,
+                                      gint           height);
+static void gtk_default_draw_check   (GtkStyle      *style,
+                                     GdkWindow     *window,
+                                     GtkStateType   state_type,
+                                     GtkShadowType  shadow_type,
+                                     GdkRectangle  *area,
+                                     GtkWidget     *widget,
+                                     gchar         *detail,
+                                     gint           x,
+                                     gint           y,
+                                     gint           width,
+                                     gint           height);
+static void gtk_default_draw_option  (GtkStyle      *style,
+                                     GdkWindow     *window,
+                                     GtkStateType   state_type,
+                                     GtkShadowType  shadow_type,
+                                     GdkRectangle  *area,
+                                     GtkWidget     *widget,
+                                     gchar         *detail,
+                                     gint           x,
+                                     gint           y,
+                                     gint           width,
+                                     gint           height);
+static void gtk_default_draw_cross   (GtkStyle      *style,
+                                     GdkWindow     *window,
+                                     GtkStateType   state_type,
+                                     GtkShadowType  shadow_type,
+                                     GdkRectangle  *area,
+                                     GtkWidget     *widget,
+                                     gchar         *detail,
+                                     gint           x,
+                                     gint           y,
+                                     gint           width,
+                                     gint           height);
+static void gtk_default_draw_ramp    (GtkStyle      *style,
+                                     GdkWindow     *window,
+                                     GtkStateType   state_type,
+                                     GtkShadowType  shadow_type,
+                                     GdkRectangle  *area,
+                                     GtkWidget     *widget,
+                                     gchar         *detail,
+                                     GtkArrowType   arrow_type,
+                                     gint           x,
+                                     gint           y,
+                                     gint           width,
+                                     gint           height);
+static void gtk_default_draw_tab     (GtkStyle      *style,
+                                     GdkWindow     *window,
+                                     GtkStateType   state_type,
+                                     GtkShadowType  shadow_type,
+                                     GdkRectangle  *area,
+                                     GtkWidget     *widget,
+                                     gchar         *detail,
+                                     gint           x,
+                                     gint           y,
+                                     gint           width,
+                                     gint           height);
+static void gtk_default_draw_shadow_gap (GtkStyle       *style,
+                                        GdkWindow      *window,
+                                        GtkStateType    state_type,
+                                        GtkShadowType   shadow_type,
+                                        GdkRectangle   *area,
+                                        GtkWidget      *widget,
+                                        gchar          *detail,
+                                        gint            x,
+                                        gint            y,
+                                        gint            width,
+                                        gint            height,
+                                        GtkPositionType gap_side,
+                                        gint            gap_x,
+                                        gint            gap_width);
+static void gtk_default_draw_box_gap (GtkStyle       *style,
+                                     GdkWindow      *window,
+                                     GtkStateType    state_type,
+                                     GtkShadowType   shadow_type,
+                                     GdkRectangle   *area,
+                                     GtkWidget      *widget,
+                                     gchar          *detail,
+                                     gint            x,
+                                     gint            y,
+                                     gint            width,
+                                     gint            height,
+                                     GtkPositionType gap_side,
+                                     gint            gap_x,
+                                     gint            gap_width);
+static void gtk_default_draw_extension (GtkStyle       *style,
+                                       GdkWindow      *window,
+                                       GtkStateType    state_type,
+                                       GtkShadowType   shadow_type,
+                                       GdkRectangle   *area,
+                                       GtkWidget      *widget,
+                                       gchar          *detail,
+                                       gint            x,
+                                       gint            y,
+                                       gint            width,
+                                       gint            height,
+                                       GtkPositionType gap_side);
+static void gtk_default_draw_focus   (GtkStyle      *style,
+                                     GdkWindow     *window,
+                                     GdkRectangle  *area,
+                                     GtkWidget     *widget,
+                                     gchar         *detail,
+                                     gint           x,
+                                     gint           y,
+                                     gint           width,
+                                     gint           height);
+static void gtk_default_draw_slider  (GtkStyle      *style,
+                                     GdkWindow     *window,
+                                     GtkStateType   state_type,
+                                     GtkShadowType  shadow_type,
+                                     GdkRectangle  *area,
+                                     GtkWidget     *widget,
+                                     gchar         *detail,
+                                     gint           x,
+                                     gint           y,
+                                     gint           width,
+                                     gint           height,
+                                     GtkOrientation orientation);
+static void gtk_default_draw_handle  (GtkStyle      *style,
+                                     GdkWindow     *window,
+                                     GtkStateType   state_type,
+                                     GtkShadowType  shadow_type,
+                                     GdkRectangle  *area,
+                                     GtkWidget     *widget,
+                                     gchar         *detail,
+                                     gint           x,
+                                     gint           y,
+                                     gint           width,
+                                     gint           height,
+                                     GtkOrientation orientation);
+
 
 static void gtk_style_shade (GdkColor *a, GdkColor *b, gdouble k);
 static void rgb_to_hls (gdouble *r, gdouble *g, gdouble *b);
 static void hls_to_rgb (gdouble *h, gdouble *l, gdouble *s);
 
+static void gtk_reset_window_and_children(GtkWidget *widget, 
+                                         GdkWindow *window);
 
-static GtkStyleClass default_class =
+
+GtkStyleClass default_class =
 {
-  2,
-  2,
-  gtk_default_draw_hline,
-  gtk_default_draw_vline,
-  gtk_default_draw_shadow,
-  gtk_default_draw_polygon,
-  gtk_default_draw_arrow,
-  gtk_default_draw_diamond,
-  gtk_default_draw_oval,
-  gtk_default_draw_string,
+   2,
+   2,
+   gtk_default_draw_hline,
+   gtk_default_draw_vline,
+   gtk_default_draw_shadow,
+   gtk_default_draw_polygon,
+   gtk_default_draw_arrow,
+   gtk_default_draw_diamond,
+   gtk_default_draw_oval,
+   gtk_default_draw_string,
+   gtk_default_draw_box,
+   gtk_default_draw_flat_box,
+   gtk_default_draw_check,
+   gtk_default_draw_option,
+   gtk_default_draw_cross,
+   gtk_default_draw_ramp,
+   gtk_default_draw_tab,
+   gtk_default_draw_shadow_gap,
+   gtk_default_draw_box_gap,
+   gtk_default_draw_extension,
+   gtk_default_draw_focus,
+   gtk_default_draw_slider,
+   gtk_default_draw_handle
 };
+GdkFont *default_font = NULL;
 
 static GdkColor gtk_default_normal_fg =      { 0,      0,      0,      0 };
 static GdkColor gtk_default_active_fg =      { 0,      0,      0,      0 };
@@ -151,13 +330,43 @@ static GdkColor gtk_default_prelight_bg =    { 0, 0xea60, 0xea60, 0xea60 };
 static GdkColor gtk_default_selected_bg =    { 0,      0,      0, 0x9c40 };
 static GdkColor gtk_default_insensitive_bg = { 0, 0xd6d6, 0xd6d6, 0xd6d6 };
 
-static GdkFont *default_font = NULL;
+static void
+gtk_reset_window_and_children(GtkWidget *widget, GdkWindow *window)
+{
+  GdkWindowPrivate *private;
+  guint i, num;
+  GList *list;
+  gpointer data;
+  
+  g_return_if_fail (window != NULL);
+  
+  private = (GdkWindowPrivate *)window;
+
+  if (private->destroyed)
+    return;
+  gdk_window_get_user_data(window, &data);
+  if ((data) && (data != widget))
+    return;
+  gdk_window_shape_combine_mask(window, NULL, 0, 0);
+  if (private->children)
+    {
+      num = g_list_length(private->children);
+      for(i = 0; i < num; i++)
+       {
+         list = g_list_nth(private->children, i);
+         gtk_reset_window_and_children(widget, (GdkWindow *)list->data);
+       }
+    }
+}
 
-static gint initialize = TRUE;
-static GCache *style_cache = NULL;
-static GSList *unattached_styles = NULL;
+void
+gtk_reset_widget_shapes(GtkWidget *widget)
+{
+  g_return_if_fail (widget != NULL);
 
-static GMemChunk *key_mem_chunk = NULL;
+  if (!GTK_WIDGET_HAS_SHAPE_MASK(GTK_OBJECT(widget)))
+    gtk_reset_window_and_children(widget, widget->window);
+}
 
 GtkStyle*
 gtk_style_copy (GtkStyle     *style)
@@ -185,6 +394,33 @@ gtk_style_copy (GtkStyle     *style)
   return new_style;
 }
 
+static GtkStyle*
+gtk_style_duplicate (GtkStyle     *style)
+{
+  GtkStyle *new_style;
+
+  g_return_val_if_fail (style != NULL, NULL);
+
+  new_style = gtk_style_copy (style);
+
+  style->styles = g_slist_append (style->styles, new_style);
+  new_style->styles = style->styles;  
+
+  if (style->rc_style)
+    {
+      new_style->rc_style = style->rc_style;
+      gtk_rc_style_ref (style->rc_style);
+    }
+  
+  if (style->engine)
+    {
+      new_style->engine = style->engine;
+      new_style->engine->duplicate_style (new_style, style);
+    }
+
+  return new_style;
+}
+
 GtkStyle*
 gtk_style_new (void)
 {
@@ -241,6 +477,11 @@ gtk_style_new (void)
   for (i = 0; i < 5; i++)
     style->bg_pixmap[i] = NULL;
 
+  style->engine = NULL;
+  style->engine_data = NULL;
+
+  style->rc_style = NULL;
+
   for (i = 0; i < 5; i++)
     {
       style->fg_gc[i] = NULL;
@@ -252,16 +493,15 @@ gtk_style_new (void)
       style->base_gc[i] = NULL;
     }
 
-  unattached_styles = g_slist_prepend (unattached_styles, style);
-
   return style;
 }
 
-GtkStyle*
+GtkStyle *
 gtk_style_attach (GtkStyle  *style,
                  GdkWindow *window)
 {
-  GtkStyle *new_style;
+  GSList *styles;
+  GtkStyle *new_style = NULL;
   GdkColormap *colormap;
   gint depth;
 
@@ -271,21 +511,41 @@ gtk_style_attach (GtkStyle  *style,
   colormap = gdk_window_get_colormap (window);
   depth = gdk_window_get_visual (window)->depth;
 
-  new_style = gtk_style_find (style, colormap, depth);
+  if (!style->styles)
+    style->styles = g_slist_append (NULL, style);
 
-  if (new_style && (new_style != style))
+  styles = style->styles;
+  while (styles)
     {
-      gtk_style_unref (style);
-      style = new_style;
-      gtk_style_ref (style);
+      new_style = styles->data;
+
+      if (new_style->attach_count == 0)
+       {
+         gtk_style_init (new_style, colormap, depth);
+         break;
+       }
+      else if ((new_style->colormap == colormap) &&
+              (new_style->depth == depth))
+       break;
+
+      new_style = NULL;
+      styles = styles->next;
     }
 
-  if (style->attach_count == 0)
-    unattached_styles = g_slist_remove (unattached_styles, style);
+  if (!new_style)
+    {
+      new_style = gtk_style_duplicate (style);
+      gtk_style_init (new_style, colormap, depth);
+    }
 
-  style->attach_count += 1;
+  if (new_style->attach_count == 0)
+    gtk_style_ref (new_style);
 
-  return style;
+
+  
+  new_style->attach_count++;
+
+  return new_style;
 }
 
 void
@@ -298,14 +558,12 @@ gtk_style_detach (GtkStyle *style)
   style->attach_count -= 1;
   if (style->attach_count == 0)
     {
-      unattached_styles = g_slist_prepend (unattached_styles, style);
+      if (style->engine)
+       style->engine->unrealize_style (style);
 
       gtk_gc_release (style->black_gc);
       gtk_gc_release (style->white_gc);
-
-      style->black_gc = NULL;
-      style->white_gc = NULL;
-
+      
       for (i = 0; i < 5; i++)
        {
          gtk_gc_release (style->fg_gc[i]);
@@ -315,21 +573,10 @@ gtk_style_detach (GtkStyle *style)
          gtk_gc_release (style->mid_gc[i]);
          gtk_gc_release (style->text_gc[i]);
          gtk_gc_release (style->base_gc[i]);
-
-         style->fg_gc[i] = NULL;
-         style->bg_gc[i] = NULL;
-         style->light_gc[i] = NULL;
-         style->dark_gc[i] = NULL;
-         style->mid_gc[i] = NULL;
-         style->text_gc[i] = NULL;
-         style->base_gc[i] = NULL;
        }
 
-      style->depth = -1;
-      style->colormap = NULL;
+      gtk_style_unref (style);
     }
-
-  gtk_style_remove (style);
 }
 
 GtkStyle*
@@ -351,6 +598,137 @@ gtk_style_unref (GtkStyle *style)
     gtk_style_destroy (style);
 }
 
+static void
+gtk_style_init (GtkStyle *style,
+               GdkColormap *colormap,
+               gint         depth)
+{
+  GdkGCValues gc_values;
+  GdkGCValuesMask gc_values_mask;
+  gint i;
+
+  g_return_if_fail (style != NULL);
+
+  style->colormap = colormap;
+  style->depth = depth;
+  
+  for (i = 0; i < 5; i++)
+    {
+      gtk_style_shade (&style->bg[i], &style->light[i], LIGHTNESS_MULT);
+      gtk_style_shade (&style->bg[i], &style->dark[i], DARKNESS_MULT);
+      
+      style->mid[i].red = (style->light[i].red + style->dark[i].red) / 2;
+      style->mid[i].green = (style->light[i].green + style->dark[i].green) / 2;
+      style->mid[i].blue = (style->light[i].blue + style->dark[i].blue) / 2;
+    }
+  
+  gdk_color_black (colormap, &style->black);
+  gdk_color_white (colormap, &style->white);
+  
+  gc_values_mask = GDK_GC_FOREGROUND | GDK_GC_FONT;
+  if (style->font->type == GDK_FONT_FONT)
+    {
+      gc_values.font = style->font;
+    }
+  else if (style->font->type == GDK_FONT_FONTSET)
+    {
+      gc_values.font = default_font;
+    }
+  
+  gc_values.foreground = style->black;
+  style->black_gc = gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask);
+  
+  gc_values.foreground = style->white;
+  style->white_gc = gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask);
+  
+  for (i = 0; i < 5; i++)
+    {
+      if (style->rc_style && style->rc_style->bg_pixmap_name[i])
+       style->bg_pixmap[i] = gtk_rc_load_image (style->colormap,
+                                                &style->bg[i],
+                                                style->rc_style->bg_pixmap_name[i]);
+      
+      if (!gdk_color_alloc (colormap, &style->fg[i]))
+       g_warning ("unable to allocate color: ( %d %d %d )",
+                  style->fg[i].red, style->fg[i].green, style->fg[i].blue);
+      if (!gdk_color_alloc (colormap, &style->bg[i]))
+       g_warning ("unable to allocate color: ( %d %d %d )",
+                  style->bg[i].red, style->bg[i].green, style->bg[i].blue);
+      if (!gdk_color_alloc (colormap, &style->light[i]))
+       g_warning ("unable to allocate color: ( %d %d %d )",
+                  style->light[i].red, style->light[i].green, style->light[i].blue);
+      if (!gdk_color_alloc (colormap, &style->dark[i]))
+       g_warning ("unable to allocate color: ( %d %d %d )",
+                  style->dark[i].red, style->dark[i].green, style->dark[i].blue);
+      if (!gdk_color_alloc (colormap, &style->mid[i]))
+       g_warning ("unable to allocate color: ( %d %d %d )",
+                  style->mid[i].red, style->mid[i].green, style->mid[i].blue);
+      if (!gdk_color_alloc (colormap, &style->text[i]))
+       g_warning ("unable to allocate color: ( %d %d %d )",
+                  style->text[i].red, style->text[i].green, style->text[i].blue);
+      if (!gdk_color_alloc (colormap, &style->base[i]))
+       g_warning ("unable to allocate color: ( %d %d %d )",
+                  style->base[i].red, style->base[i].green, style->base[i].blue);
+      
+      gc_values.foreground = style->fg[i];
+      style->fg_gc[i] = gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask);
+      
+      gc_values.foreground = style->bg[i];
+      style->bg_gc[i] = gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask);
+      
+      gc_values.foreground = style->light[i];
+      style->light_gc[i] = gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask);
+      
+      gc_values.foreground = style->dark[i];
+      style->dark_gc[i] = gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask);
+      
+      gc_values.foreground = style->mid[i];
+      style->mid_gc[i] = gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask);
+      
+      gc_values.foreground = style->text[i];
+      style->text_gc[i] = gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask);
+
+      gc_values.foreground = style->base[i];
+      style->base_gc[i] = gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask);
+    }
+  if (style->engine)
+    style->engine->realize_style (style);
+}
+
+static void
+gtk_style_destroy (GtkStyle *style)
+{
+  g_return_if_fail (style->attach_count == 0);
+
+  if (style->styles)
+    {
+      if (style->styles->data != style)
+       g_slist_remove (style->styles, style);
+      else
+       {
+         GSList *tmp_list = style->styles->next;
+         while (tmp_list)
+           {
+             ((GtkStyle *)tmp_list->data)->styles = style->styles->next;
+             tmp_list = tmp_list->next;
+           }
+         g_slist_free_1 (style->styles);
+       }
+    }
+
+  if (style->engine)
+    {
+      style->engine->destroy_style (style);
+      gtk_theme_engine_unref (style->engine);
+    }
+
+  gdk_font_unref (style->font);
+  if (style->rc_style)
+    gtk_rc_style_unref (style->rc_style);
+
+  g_free (style);
+}
+
 void
 gtk_style_set_background (GtkStyle     *style,
                          GdkWindow    *window,
@@ -359,8 +737,14 @@ gtk_style_set_background (GtkStyle     *style,
   GdkPixmap *pixmap;
   gint parent_relative;
 
-  g_return_if_fail (style != NULL);
-  g_return_if_fail (window != NULL);
+   if (style->engine && style->engine->set_background)
+     {
+        (*style->engine->set_background) (style, window, state_type);
+       return;
+     }
+   
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (window != NULL);
 
   if (style->bg_pixmap[state_type])
     {
@@ -394,7 +778,7 @@ gtk_draw_hline (GtkStyle     *style,
   g_return_if_fail (style->klass != NULL);
   g_return_if_fail (style->klass->draw_hline != NULL);
 
-  (*style->klass->draw_hline) (style, window, state_type, x1, x2, y);
+  (*style->klass->draw_hline) (style, window, state_type, NULL, NULL, NULL, x1, x2, y);
 }
 
 
@@ -410,7 +794,7 @@ gtk_draw_vline (GtkStyle     *style,
   g_return_if_fail (style->klass != NULL);
   g_return_if_fail (style->klass->draw_vline != NULL);
 
-  (*style->klass->draw_vline) (style, window, state_type, y1, y2, x);
+  (*style->klass->draw_vline) (style, window, state_type, NULL, NULL, NULL, y1, y2, x);
 }
 
 
@@ -428,7 +812,7 @@ gtk_draw_shadow (GtkStyle      *style,
   g_return_if_fail (style->klass != NULL);
   g_return_if_fail (style->klass->draw_shadow != NULL);
 
-  (*style->klass->draw_shadow) (style, window, state_type, shadow_type, x, y, width, height);
+   (*style->klass->draw_shadow) (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
 }
 
 void
@@ -438,13 +822,13 @@ gtk_draw_polygon (GtkStyle      *style,
                  GtkShadowType  shadow_type,
                  GdkPoint      *points,
                  gint           npoints,
-                 gint           fill)
+                 gboolean       fill)
 {
   g_return_if_fail (style != NULL);
   g_return_if_fail (style->klass != NULL);
   g_return_if_fail (style->klass->draw_shadow != NULL);
 
-  (*style->klass->draw_polygon) (style, window, state_type, shadow_type, points, npoints, fill);
+  (*style->klass->draw_polygon) (style, window, state_type, shadow_type, NULL, NULL, NULL, points, npoints, fill);
 }
 
 void
@@ -453,7 +837,7 @@ gtk_draw_arrow (GtkStyle      *style,
                GtkStateType   state_type,
                GtkShadowType  shadow_type,
                GtkArrowType   arrow_type,
-               gint           fill,
+               gboolean       fill,
                gint           x,
                gint           y,
                gint           width,
@@ -463,7 +847,7 @@ gtk_draw_arrow (GtkStyle      *style,
   g_return_if_fail (style->klass != NULL);
   g_return_if_fail (style->klass->draw_arrow != NULL);
 
-  (*style->klass->draw_arrow) (style, window, state_type, shadow_type, arrow_type, fill, x, y, width, height);
+  (*style->klass->draw_arrow) (style, window, state_type, shadow_type, NULL, NULL, NULL, arrow_type, fill, x, y, width, height);
 }
 
 
@@ -481,7 +865,7 @@ gtk_draw_diamond (GtkStyle      *style,
   g_return_if_fail (style->klass != NULL);
   g_return_if_fail (style->klass->draw_diamond != NULL);
 
-  (*style->klass->draw_diamond) (style, window, state_type, shadow_type, x, y, width, height);
+  (*style->klass->draw_diamond) (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
 }
 
 
@@ -499,7 +883,7 @@ gtk_draw_oval (GtkStyle      *style,
   g_return_if_fail (style->klass != NULL);
   g_return_if_fail (style->klass->draw_oval != NULL);
 
-  (*style->klass->draw_oval) (style, window, state_type, shadow_type, x, y, width, height);
+  (*style->klass->draw_oval) (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
 }
 
 void
@@ -514,466 +898,345 @@ gtk_draw_string (GtkStyle      *style,
   g_return_if_fail (style->klass != NULL);
   g_return_if_fail (style->klass->draw_oval != NULL);
 
-  (*style->klass->draw_string) (style, window, state_type, x, y, string);
+  (*style->klass->draw_string) (style, window, state_type, NULL, NULL, NULL, x, y, string);
 }
 
-
-static void
-gtk_style_init (GtkStyle *style)
+void
+gtk_draw_box (GtkStyle      *style,
+                GdkWindow     *window,
+                GtkStateType   state_type,
+                GtkShadowType  shadow_type,
+                gint           x,
+                gint           y,
+                gint           width,
+                gint           height)
 {
-  GdkGCValues gc_values;
-  GdkGCValuesMask gc_values_mask;
-  GdkColormap *colormap;
-  gint i;
-
-  g_return_if_fail (style != NULL);
-
-  if (style->attach_count == 0)
-    {
-      for (i = 0; i < 5; i++)
-       {
-         gtk_style_shade (&style->bg[i], &style->light[i], LIGHTNESS_MULT);
-         gtk_style_shade (&style->bg[i], &style->dark[i], DARKNESS_MULT);
-
-         style->mid[i].red = (style->light[i].red + style->dark[i].red) / 2;
-         style->mid[i].green = (style->light[i].green + style->dark[i].green) / 2;
-         style->mid[i].blue = (style->light[i].blue + style->dark[i].blue) / 2;
-       }
-
-      colormap = style->colormap;
-
-      gdk_color_black (colormap, &style->black);
-      gdk_color_white (colormap, &style->white);
-
-      gc_values_mask = GDK_GC_FOREGROUND | GDK_GC_FONT;
-      if (style->font->type == GDK_FONT_FONT)
-       {
-         gc_values.font = style->font;
-       }
-      else if (style->font->type == GDK_FONT_FONTSET)
-       {
-         gc_values.font = default_font;
-       }
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (style->klass != NULL);
+   g_return_if_fail (style->klass->draw_box != NULL);
 
-      gc_values.foreground = style->black;
-      style->black_gc = gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask);
-
-      gc_values.foreground = style->white;
-      style->white_gc = gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask);
-
-      for (i = 0; i < 5; i++)
-       {
-         if (!gdk_color_alloc (colormap, &style->fg[i]))
-           g_warning ("unable to allocate color: ( %d %d %d )",
-                      style->fg[i].red, style->fg[i].green, style->fg[i].blue);
-         if (!gdk_color_alloc (colormap, &style->bg[i]))
-           g_warning ("unable to allocate color: ( %d %d %d )",
-                      style->bg[i].red, style->bg[i].green, style->bg[i].blue);
-         if (!gdk_color_alloc (colormap, &style->light[i]))
-           g_warning ("unable to allocate color: ( %d %d %d )",
-                      style->light[i].red, style->light[i].green, style->light[i].blue);
-         if (!gdk_color_alloc (colormap, &style->dark[i]))
-           g_warning ("unable to allocate color: ( %d %d %d )",
-                      style->dark[i].red, style->dark[i].green, style->dark[i].blue);
-         if (!gdk_color_alloc (colormap, &style->mid[i]))
-           g_warning ("unable to allocate color: ( %d %d %d )",
-                      style->mid[i].red, style->mid[i].green, style->mid[i].blue);
-         if (!gdk_color_alloc (colormap, &style->text[i]))
-           g_warning ("unable to allocate color: ( %d %d %d )",
-                      style->text[i].red, style->text[i].green, style->text[i].blue);
-         if (!gdk_color_alloc (colormap, &style->base[i]))
-           g_warning ("unable to allocate color: ( %d %d %d )",
-                      style->base[i].red, style->base[i].green, style->base[i].blue);
-
-         gc_values.foreground = style->fg[i];
-         style->fg_gc[i] = gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask);
-
-         gc_values.foreground = style->bg[i];
-         style->bg_gc[i] = gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask);
-
-         gc_values.foreground = style->light[i];
-         style->light_gc[i] = gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask);
-
-         gc_values.foreground = style->dark[i];
-         style->dark_gc[i] = gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask);
-
-         gc_values.foreground = style->mid[i];
-         style->mid_gc[i] = gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask);
-
-         gc_values.foreground = style->text[i];
-         style->text_gc[i] = gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask);
-
-         gc_values.foreground = style->base[i];
-         style->base_gc[i] = gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask);
-       }
-    }
+   (*style->klass->draw_box) (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
 }
 
-static void
-gtk_styles_init (void)
+void
+gtk_draw_flat_box (GtkStyle      *style,
+                  GdkWindow     *window,
+                  GtkStateType   state_type,
+                  GtkShadowType  shadow_type,
+                  gint           x,
+                  gint           y,
+                  gint           width,
+                  gint           height)
 {
-  if (initialize)
-    {
-      initialize = FALSE;
-
-      style_cache = g_cache_new ((GCacheNewFunc) gtk_style_new_from_key,
-                                (GCacheDestroyFunc) gtk_style_unref,
-                                (GCacheDupFunc) gtk_style_key_dup,
-                                (GCacheDestroyFunc) gtk_style_key_destroy,
-                                (GHashFunc) gtk_style_key_hash,
-                                (GHashFunc) gtk_style_value_hash,
-                                (GCompareFunc) gtk_style_key_compare);
-    }
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (style->klass != NULL);
+   g_return_if_fail (style->klass->draw_flat_box != NULL);
+   
+   (*style->klass->draw_flat_box) (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
 }
 
-static void
-gtk_style_remove (GtkStyle *style)
+void
+gtk_draw_check   (GtkStyle      *style,
+                 GdkWindow     *window,
+                 GtkStateType   state_type,
+                 GtkShadowType  shadow_type,
+                 gint           x,
+                 gint           y,
+                 gint           width,
+                 gint           height)
 {
-  if (initialize)
-    gtk_styles_init ();
-  g_cache_remove (style_cache, style);
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (style->klass != NULL);
+   g_return_if_fail (style->klass->draw_check != NULL);
+   
+   (*style->klass->draw_check) (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
 }
 
-static GtkStyle*
-gtk_style_find (GtkStyle    *style,
-               GdkColormap *cmap,
-               gint         depth)
+void
+gtk_draw_option  (GtkStyle      *style,
+                 GdkWindow     *window,
+                 GtkStateType   state_type,
+                 GtkShadowType  shadow_type,
+                 gint           x,
+                 gint           y,
+                 gint           width,
+                 gint           height)
 {
-  GtkStyleKey key;
-  gint i;
-
-  if (initialize)
-    gtk_styles_init ();
-
-  for (i = 0; i < 5; i++)
-    {
-      key.fg[i] = style->fg[i];
-      key.bg[i] = style->bg[i];
-      key.text[i] = style->text[i];
-      key.base[i] = style->base[i];
-      key.bg_pixmap[i] = style->bg_pixmap[i];
-    }
-
-  key.font = style->font;
-  key.klass = style->klass;
-  key.depth = depth;
-  key.colormap = cmap;
-
-  style = g_cache_insert (style_cache, &key);
-
-  return style;
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (style->klass != NULL);
+   g_return_if_fail (style->klass->draw_option != NULL);
+   
+   (*style->klass->draw_option) (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
 }
 
-static GtkStyle*
-gtk_style_new_from_key (GtkStyleKey *key)
+void
+gtk_draw_cross   (GtkStyle      *style,
+                 GdkWindow     *window,
+                 GtkStateType   state_type,
+                 GtkShadowType  shadow_type,
+                 gint           x,
+                 gint           y,
+                 gint           width,
+                 gint           height)
 {
-  GtkStyle *style;
-  GSList *list;
-  gint i;
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (style->klass != NULL);
+   g_return_if_fail (style->klass->draw_cross != NULL);
 
-  style = NULL;
-  list = unattached_styles;
+   (*style->klass->draw_cross) (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
+}
 
-  while (list)
-    {
-      style = list->data;
-      list = list->next;
-
-      if ((style->depth != -1) && (style->depth != key->depth))
-       {
-         style = NULL;
-         continue;
-       }
-      if (style->colormap && (style->colormap != key->colormap))
-       {
-         style = NULL;
-         continue;
-       }
-      if (style->klass != key->klass)
-       {
-         style = NULL;
-         continue;
-       }
-      if (!gdk_font_equal (style->font, key->font))
-       {
-         style = NULL;
-         continue;
-       }
-
-      for (i = 0; style && (i < 5); i++)
-       {
-         if (style->bg_pixmap[i] != key->bg_pixmap[i])
-           {
-             style = NULL;
-             continue;
-           }
-
-         if ((style->fg[i].red != key->fg[i].red) ||
-             (style->fg[i].green != key->fg[i].green) ||
-             (style->fg[i].blue != key->fg[i].blue))
-           {
-             style = NULL;
-             continue;
-           }
-
-         if ((style->bg[i].red != key->bg[i].red) ||
-             (style->bg[i].green != key->bg[i].green) ||
-             (style->bg[i].blue != key->bg[i].blue))
-           {
-             style = NULL;
-             continue;
-           }
-
-         if ((style->text[i].red != key->text[i].red) ||
-             (style->text[i].green != key->text[i].green) ||
-             (style->text[i].blue != key->text[i].blue))
-           {
-             style = NULL;
-             continue;
-           }
-
-         if ((style->base[i].red != key->base[i].red) ||
-             (style->base[i].green != key->base[i].green) ||
-             (style->base[i].blue != key->base[i].blue))
-           {
-             style = NULL;
-             continue;
-           }
-       }
-
-      if (style)
-       {
-         gtk_style_ref (style);
-         break;
-       }
-    }
-
-  if (!style)
-    {
-      style = g_new0 (GtkStyle, 1);
-
-      style->ref_count = 1;
-      style->attach_count = 0;
-
-      style->font = key->font;
-      gdk_font_ref (style->font);
-
-      style->depth = key->depth;
-      style->colormap = key->colormap;
-      style->klass = key->klass;
-
-      style->black.red = 0;
-      style->black.green = 0;
-      style->black.blue = 0;
-
-      style->white.red = 65535;
-      style->white.green = 65535;
-      style->white.blue = 65535;
-
-      style->black_gc = NULL;
-      style->white_gc = NULL;
-
-      for (i = 0; i < 5; i++)
-       {
-         style->fg[i] = key->fg[i];
-         style->bg[i] = key->bg[i];
-         style->text[i] = key->text[i];
-         style->base[i] = key->base[i];
-       }
-
-      for (i = 0; i < 5; i++)
-       style->bg_pixmap[i] = key->bg_pixmap[i];
-
-      for (i = 0; i < 5; i++)
-       {
-         style->fg_gc[i] = NULL;
-         style->bg_gc[i] = NULL;
-         style->light_gc[i] = NULL;
-         style->dark_gc[i] = NULL;
-         style->mid_gc[i] = NULL;
-         style->text_gc[i] = NULL;
-         style->base_gc[i] = NULL;
-       }
-    }
-
-  if (style->depth == -1)
-    style->depth = key->depth;
-  if (!style->colormap)
-    style->colormap = key->colormap;
-
-  gtk_style_init (style);
+void
+gtk_draw_ramp    (GtkStyle      *style,
+                 GdkWindow     *window,
+                 GtkStateType   state_type,
+                 GtkShadowType  shadow_type,
+                 GtkArrowType   arrow_type,
+                 gint           x,
+                 gint           y,
+                 gint           width,
+                 gint           height)
+{
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (style->klass != NULL);
+   g_return_if_fail (style->klass->draw_ramp != NULL);
 
-  return style;
+   (*style->klass->draw_ramp) (style, window, state_type, shadow_type, NULL, NULL, NULL, arrow_type, x, y, width, height);
 }
 
-static GtkStyleKey*
-gtk_style_key_dup (GtkStyleKey *key)
+void
+gtk_draw_tab     (GtkStyle      *style,
+                 GdkWindow     *window,
+                 GtkStateType   state_type,
+                 GtkShadowType  shadow_type,
+                 gint           x,
+                 gint           y,
+                 gint           width,
+                 gint           height)
 {
-  GtkStyleKey *new_key;
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (style->klass != NULL);
+   g_return_if_fail (style->klass->draw_tab != NULL);
 
-  if (!key_mem_chunk)
-    key_mem_chunk = g_mem_chunk_new ("key mem chunk", sizeof (GtkStyleKey),
-                                    1024, G_ALLOC_AND_FREE);
-
-  new_key = g_chunk_new (GtkStyleKey, key_mem_chunk);
+   (*style->klass->draw_tab) (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
+}
 
-  *new_key = *key;
+void
+gtk_draw_shadow_gap (GtkStyle       *style,
+                    GdkWindow      *window,
+                    GtkStateType    state_type,
+                    GtkShadowType   shadow_type,
+                    gint            x,
+                    gint            y,
+                    gint            width,
+                    gint            height,
+                    GtkPositionType gap_side,
+                    gint            gap_x,
+                    gint            gap_width)
+{
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (style->klass != NULL);
+   g_return_if_fail (style->klass->draw_shadow_gap != NULL);
 
-  return new_key;
+   (*style->klass->draw_shadow_gap) (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, gap_side, gap_x, gap_width);
 }
 
-static void
-gtk_style_destroy (GtkStyle *style)
+void
+gtk_draw_box_gap (GtkStyle       *style,
+                 GdkWindow      *window,
+                 GtkStateType    state_type,
+                 GtkShadowType   shadow_type,
+                 gint            x,
+                 gint            y,
+                 gint            width,
+                 gint            height,
+                 GtkPositionType gap_side,
+                 gint            gap_x,
+                 gint            gap_width)
 {
-  gint i;
-
-  if (style->attach_count > 0)
-    {
-      gtk_gc_release (style->black_gc);
-      gtk_gc_release (style->white_gc);
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (style->klass != NULL);
+   g_return_if_fail (style->klass->draw_box_gap != NULL);
 
-      for (i = 0; i < 5; i++)
-       {
-         gtk_gc_release (style->fg_gc[i]);
-         gtk_gc_release (style->bg_gc[i]);
-         gtk_gc_release (style->light_gc[i]);
-         gtk_gc_release (style->dark_gc[i]);
-         gtk_gc_release (style->mid_gc[i]);
-         gtk_gc_release (style->text_gc[i]);
-         gtk_gc_release (style->base_gc[i]);
-       }
-    }
+   (*style->klass->draw_box_gap) (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, gap_side, gap_x, gap_width);
+}
 
-  unattached_styles = g_slist_remove (unattached_styles, style);
+void
+gtk_draw_extension (GtkStyle       *style,
+                   GdkWindow      *window,
+                   GtkStateType    state_type,
+                   GtkShadowType   shadow_type,
+                   gint            x,
+                   gint            y,
+                   gint            width,
+                   gint            height,
+                   GtkPositionType gap_side)
+{
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (style->klass != NULL);
+   g_return_if_fail (style->klass->draw_extension != NULL);
 
-  gdk_font_unref (style->font);
-  g_free (style);
+   (*style->klass->draw_extension) (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, gap_side);
 }
 
-static void
-gtk_style_key_destroy (GtkStyleKey *key)
+void
+gtk_draw_focus  (GtkStyle      *style,
+                GdkWindow     *window,
+                gint           x,
+                gint           y,
+                gint           width,
+                gint           height)
 {
-  g_mem_chunk_free (key_mem_chunk, key);
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (style->klass != NULL);
+   g_return_if_fail (style->klass->draw_focus != NULL);
+   
+   (*style->klass->draw_focus) (style, window, NULL, NULL, NULL, x, y, width, height);
 }
 
-static guint
-gtk_style_key_hash (GtkStyleKey *key)
+void 
+gtk_draw_slider  (GtkStyle      *style,
+                 GdkWindow     *window,
+                 GtkStateType   state_type,
+                 GtkShadowType  shadow_type,
+                 gint           x,
+                 gint           y,
+                 gint           width,
+                 gint           height,
+                 GtkOrientation orientation)
 {
-  guint hash_val;
-  gint i;
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (style->klass != NULL);
+   g_return_if_fail (style->klass->draw_slider != NULL);
 
-  hash_val = 0;
-
-  for (i = 0; i < 5; i++)
-    {
-      hash_val += key->fg[i].red + key->fg[i].green + key->fg[i].blue;
-      hash_val += key->bg[i].red + key->bg[i].green + key->bg[i].blue;
-      hash_val += key->text[i].red + key->text[i].green + key->text[i].blue;
-      hash_val += key->base[i].red + key->base[i].green + key->base[i].blue;
-    }
-
-  hash_val += (guint) gdk_font_id (key->font);
-  hash_val += (guint) key->depth;
-  hash_val += (gulong) key->colormap;
-  hash_val += (gulong) key->klass;
-
-  return hash_val;
+   (*style->klass->draw_slider) (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, orientation);
 }
 
-static guint
-gtk_style_value_hash (GtkStyle *style)
+void 
+gtk_draw_handle  (GtkStyle      *style,
+                 GdkWindow     *window,
+                 GtkStateType   state_type,
+                 GtkShadowType  shadow_type,
+                 gint           x,
+                 gint           y,
+                 gint           width,
+                 gint           height,
+                 GtkOrientation orientation)
 {
-  guint hash_val;
-  gint i;
-
-  hash_val = 0;
-
-  for (i = 0; i < 5; i++)
-    {
-      hash_val += style->fg[i].red + style->fg[i].green + style->fg[i].blue;
-      hash_val += style->bg[i].red + style->bg[i].green + style->bg[i].blue;
-      hash_val += style->text[i].red + style->text[i].green + style->text[i].blue;
-      hash_val += style->base[i].red + style->base[i].green + style->base[i].blue;
-    }
-
-  hash_val += (guint) gdk_font_id (style->font);
-  hash_val += (gulong) style->klass;
-
-  return hash_val;
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (style->klass != NULL);
+   g_return_if_fail (style->klass->draw_handle != NULL);
+   
+   (*style->klass->draw_handle) (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, orientation);
 }
 
-static gint
-gtk_style_key_compare (GtkStyleKey *a,
-                      GtkStyleKey *b)
+/* Default functions */
+void
+gtk_style_apply_default_pixmap(GtkStyle     *style,
+                              GdkWindow    *window, 
+                              GtkStateType  state_type, 
+                              GdkRectangle *area, 
+                              gint x, 
+                              gint y, 
+                              gint width, 
+                              gint height)
 {
-  gint i;
+  GdkRectangle new_rect, old_rect;
+  GdkGC       *gc;
 
-  if (a->depth != b->depth)
-    return FALSE;
-  if (a->colormap != b->colormap)
-    return FALSE;
-  if (a->klass != b->klass)
-    return FALSE;
-  if (!gdk_font_equal (a->font, b->font))
-    return FALSE;
-
-  for (i = 0; i < 5; i++)
+  if ((!style->bg_pixmap[state_type]) ||
+      (gdk_window_get_type(window) == GDK_WINDOW_PIXMAP))
     {
-      if (a->bg_pixmap[i] != b->bg_pixmap[i])
-       return FALSE;
-
-      if ((a->fg[i].red != b->fg[i].red) ||
-         (a->fg[i].green != b->fg[i].green) ||
-         (a->fg[i].blue != b->fg[i].blue))
-       return FALSE;
-      if ((a->bg[i].red != b->bg[i].red) ||
-         (a->bg[i].green != b->bg[i].green) ||
-         (a->bg[i].blue != b->bg[i].blue))
-       return FALSE;
-      if ((a->text[i].red != b->text[i].red) ||
-         (a->text[i].green != b->text[i].green) ||
-         (a->text[i].blue != b->text[i].blue))
-       return FALSE;
-      if ((a->base[i].red != b->base[i].red) ||
-         (a->base[i].green != b->base[i].green) ||
-         (a->base[i].blue != b->base[i].blue))
-       return FALSE;
+      gc = style->bg_gc[state_type];
+
+      old_rect.x = x;
+      old_rect.y = y;
+      old_rect.width = width;
+      old_rect.height = height;
+      
+      if (area)
+       {
+         if (gdk_rectangle_intersect(area, &old_rect, &new_rect))
+           gdk_draw_rectangle(window, gc, TRUE, 
+                              new_rect.x, new_rect.y, new_rect.width, new_rect.height);
+       }
+      else
+       gdk_draw_rectangle(window, gc, TRUE, 
+                          x, y, width, height);
+    }
+  else
+    {
+      if (style->bg_pixmap[state_type] == (GdkPixmap*) GDK_PARENT_RELATIVE)
+       gdk_window_set_back_pixmap(window, NULL, TRUE);
+      else
+       gdk_window_set_back_pixmap(window, style->bg_pixmap[state_type], FALSE);
+      
+      old_rect.x = x;
+      old_rect.y = y;
+      old_rect.width = width;
+      old_rect.height = height;
+      
+      if ((area) && (gdk_rectangle_intersect(area, &old_rect, &new_rect)))
+       gdk_window_clear_area(window, new_rect.x, new_rect.y, new_rect.width, new_rect.height);
+      else
+       gdk_window_clear_area(window, x, y, width, height);
     }
-
-  return TRUE;
 }
 
-
 static void
 gtk_default_draw_hline (GtkStyle     *style,
                        GdkWindow    *window,
                        GtkStateType  state_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
                        gint          x1,
                        gint          x2,
                        gint          y)
 {
-  gint thickness_light;
-  gint thickness_dark;
-  gint i;
-
-  g_return_if_fail (style != NULL);
-  g_return_if_fail (window != NULL);
-
-  thickness_light = style->klass->ythickness / 2;
-  thickness_dark = style->klass->ythickness - thickness_light;
-
-  for (i = 0; i < thickness_dark; i++)
-    {
-      gdk_draw_line (window, style->light_gc[state_type], x2 - i - 1, y + i, x2, y + i);
-      gdk_draw_line (window, style->dark_gc[state_type], x1, y + i, x2 - i - 1, y + i);
-    }
-
-  y += thickness_dark;
-  for (i = 0; i < thickness_light; i++)
-    {
-      gdk_draw_line (window, style->dark_gc[state_type], x1, y + i, x1 + thickness_light - i - 1, y + i);
-      gdk_draw_line (window, style->light_gc[state_type], x1 + thickness_light - i - 1, y + i, x2, y + i);
-    }
+   gint thickness_light;
+   gint thickness_dark;
+   gint i;
+   
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (window != NULL);
+   
+   thickness_light = style->klass->ythickness / 2;
+   thickness_dark = style->klass->ythickness - thickness_light;
+   
+   if (area)
+     {
+       gdk_gc_set_clip_rectangle (style->light_gc[state_type], area);
+       gdk_gc_set_clip_rectangle (style->dark_gc[state_type], area);
+     }
+
+   if (detail && !strcmp (detail, "label"))
+     {
+       if (state_type == GTK_STATE_INSENSITIVE)
+        gdk_draw_line (window, style->white_gc, x1 + 1, y + 1, x2 + 1, y + 1);  
+       gdk_draw_line (window, style->fg_gc[state_type], x1, y, x2, y);     
+     }
+   else
+     {
+       for (i = 0; i < thickness_dark; i++)
+        {
+          gdk_draw_line (window, style->light_gc[state_type], x2 - i - 1, y + i, x2, y + i);
+          gdk_draw_line (window, style->dark_gc[state_type], x1, y + i, x2 - i - 1, y + i);
+        }
+       
+       y += thickness_dark;
+       for (i = 0; i < thickness_light; i++)
+        {
+          gdk_draw_line (window, style->dark_gc[state_type], x1, y + i, x1 + thickness_light - i - 1, y + i);
+          gdk_draw_line (window, style->light_gc[state_type], x1 + thickness_light - i - 1, y + i, x2, y + i);
+        }
+     }
+   
+   if (area)
+     {
+       gdk_gc_set_clip_rectangle (style->light_gc[state_type], NULL);
+       gdk_gc_set_clip_rectangle (style->dark_gc[state_type], NULL);
+     }
 }
 
 
@@ -981,32 +1244,45 @@ static void
 gtk_default_draw_vline (GtkStyle     *style,
                        GdkWindow    *window,
                        GtkStateType  state_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
                        gint          y1,
                        gint          y2,
                        gint          x)
 {
-  gint thickness_light;
-  gint thickness_dark;
-  gint i;
-
-  g_return_if_fail (style != NULL);
-  g_return_if_fail (window != NULL);
-
-  thickness_light = style->klass->xthickness / 2;
-  thickness_dark = style->klass->xthickness - thickness_light;
-
-  for (i = 0; i < thickness_dark; i++)
-    {
-      gdk_draw_line (window, style->light_gc[state_type], x + i, y2 - i - 1, x + i, y2);
+   gint thickness_light;
+   gint thickness_dark;
+   gint i;
+   
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (window != NULL);
+   
+   thickness_light = style->klass->xthickness / 2;
+   thickness_dark = style->klass->xthickness - thickness_light;
+   
+   if (area)
+     {
+       gdk_gc_set_clip_rectangle (style->light_gc[state_type], area);
+       gdk_gc_set_clip_rectangle (style->dark_gc[state_type], area);
+     }
+   for (i = 0; i < thickness_dark; i++)
+     {
+       gdk_draw_line (window, style->light_gc[state_type], x + i, y2 - i - 1, x + i, y2);
       gdk_draw_line (window, style->dark_gc[state_type], x + i, y1, x + i, y2 - i - 1);
-    }
-
-  x += thickness_dark;
-  for (i = 0; i < thickness_light; i++)
-    {
-      gdk_draw_line (window, style->dark_gc[state_type], x + i, y1, x + i, y1 + thickness_light - i);
-      gdk_draw_line (window, style->light_gc[state_type], x + i, y1 + thickness_light - i, x + i, y2);
-    }
+     }
+   
+   x += thickness_dark;
+   for (i = 0; i < thickness_light; i++)
+     {
+       gdk_draw_line (window, style->dark_gc[state_type], x + i, y1, x + i, y1 + thickness_light - i);
+       gdk_draw_line (window, style->light_gc[state_type], x + i, y1 + thickness_light - i, x + i, y2);
+     }
+   if (area)
+     {
+       gdk_gc_set_clip_rectangle (style->light_gc[state_type], NULL);
+       gdk_gc_set_clip_rectangle (style->dark_gc[state_type], NULL);
+     }
 }
 
 
@@ -1015,13 +1291,16 @@ gtk_default_draw_shadow (GtkStyle      *style,
                         GdkWindow     *window,
                         GtkStateType   state_type,
                         GtkShadowType  shadow_type,
+                        GdkRectangle  *area,
+                        GtkWidget     *widget,
+                        gchar         *detail,
                         gint           x,
                         gint           y,
                         gint           width,
                         gint           height)
 {
-  GdkGC *gc1;
-  GdkGC *gc2;
+  GdkGC *gc1 = NULL;
+  GdkGC *gc2 = NULL;
   gint thickness_light;
   gint thickness_dark;
   gint i;
@@ -1039,9 +1318,7 @@ gtk_default_draw_shadow (GtkStyle      *style,
   switch (shadow_type)
     {
     case GTK_SHADOW_NONE:
-      gc1 = NULL;
-      gc2 = NULL;
-      break;
+      return;
     case GTK_SHADOW_IN:
     case GTK_SHADOW_ETCHED_IN:
       gc1 = style->light_gc[state_type];
@@ -1054,7 +1331,18 @@ gtk_default_draw_shadow (GtkStyle      *style,
       break;
     }
 
-  switch (shadow_type)
+   if (area)
+     {
+       gdk_gc_set_clip_rectangle (gc1, area);
+       gdk_gc_set_clip_rectangle (gc2, area);
+       if ((shadow_type == GTK_SHADOW_IN) || 
+          (shadow_type == GTK_SHADOW_OUT))
+        {
+          gdk_gc_set_clip_rectangle (style->black_gc, area);
+          gdk_gc_set_clip_rectangle (style->bg_gc[state_type], area);
+        }
+     }
+   switch (shadow_type)
     {
     case GTK_SHADOW_NONE:
       break;
@@ -1159,6 +1447,17 @@ gtk_default_draw_shadow (GtkStyle      *style,
         }
       break;
     }
+   if (area)
+     {
+       gdk_gc_set_clip_rectangle (gc1, NULL);
+       gdk_gc_set_clip_rectangle (gc2, NULL);
+       if ((shadow_type == GTK_SHADOW_IN) || 
+           (shadow_type == GTK_SHADOW_OUT))
+         {
+           gdk_gc_set_clip_rectangle (style->black_gc, NULL);
+           gdk_gc_set_clip_rectangle (style->bg_gc[state_type], NULL);
+         }
+     }
 }
 
 
@@ -1167,9 +1466,12 @@ gtk_default_draw_polygon (GtkStyle      *style,
                          GdkWindow     *window,
                          GtkStateType   state_type,
                          GtkShadowType  shadow_type,
+                         GdkRectangle  *area,
+                         GtkWidget     *widget,
+                         gchar         *detail,
                          GdkPoint      *points,
                          gint           npoints,
-                         gint           fill)
+                         gboolean       fill)
 {
 #ifndef M_PI
 #define M_PI    3.14159265358979323846
@@ -1202,17 +1504,37 @@ gtk_default_draw_polygon (GtkStyle      *style,
       gc3 = style->light_gc[state_type];
       gc4 = style->black_gc;
       break;
+     case GTK_SHADOW_ETCHED_IN:
+      gc1 = style->light_gc[state_type];
+      gc2 = style->dark_gc[state_type];
+      gc3 = style->dark_gc[state_type];
+      gc4 = style->light_gc[state_type];
+      break;
     case GTK_SHADOW_OUT:
       gc1 = style->dark_gc[state_type];
       gc2 = style->light_gc[state_type];
       gc3 = style->black_gc;
       gc4 = style->bg_gc[state_type];
       break;
+     case GTK_SHADOW_ETCHED_OUT:
+      gc1 = style->dark_gc[state_type];
+      gc2 = style->light_gc[state_type];
+      gc3 = style->light_gc[state_type];
+      gc4 = style->dark_gc[state_type];
+      break;
     default:
       return;
     }
 
-  if (fill)
+   if (area)
+     {
+       gdk_gc_set_clip_rectangle (gc1, area);
+       gdk_gc_set_clip_rectangle (gc2, area);
+       gdk_gc_set_clip_rectangle (gc3, area);
+       gdk_gc_set_clip_rectangle (gc4, area);
+     }
+   
+   if (fill)
     gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, points, npoints);
 
   npoints--;
@@ -1271,6 +1593,13 @@ gtk_default_draw_polygon (GtkStyle      *style,
                         points[i+1].x, points[i+1].y);
        }
     }
+   if (area)
+     {
+       gdk_gc_set_clip_rectangle (gc1, NULL);
+       gdk_gc_set_clip_rectangle (gc2, NULL);
+       gdk_gc_set_clip_rectangle (gc3, NULL);
+       gdk_gc_set_clip_rectangle (gc4, NULL);
+     }
 }
 
 static void
@@ -1278,346 +1607,1187 @@ gtk_default_draw_arrow (GtkStyle      *style,
                        GdkWindow     *window,
                        GtkStateType   state_type,
                        GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
                        GtkArrowType   arrow_type,
-                       gint           fill,
+                       gboolean       fill,
                        gint           x,
                        gint           y,
                        gint           width,
                        gint           height)
 {
-  GdkGC *gc1;
-  GdkGC *gc2;
-  GdkGC *gc3;
-  GdkGC *gc4;
-  gint half_width;
-  gint half_height;
-  GdkPoint points[3];
+   GdkGC *gc1;
+   GdkGC *gc2;
+   GdkGC *gc3;
+   GdkGC *gc4;
+   gint half_width;
+   gint half_height;
+   GdkPoint points[3];
+   
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (window != NULL);
+   
+   switch (shadow_type)
+     {
+      case GTK_SHADOW_IN:
+       gc1 = style->bg_gc[state_type];
+       gc2 = style->dark_gc[state_type];
+       gc3 = style->light_gc[state_type];
+       gc4 = style->black_gc;
+       break;
+      case GTK_SHADOW_OUT:
+       gc1 = style->dark_gc[state_type];
+       gc2 = style->light_gc[state_type];
+       gc3 = style->black_gc;
+       gc4 = style->bg_gc[state_type];
+       break;
+      case GTK_SHADOW_ETCHED_IN:
+       gc1 = style->light_gc[state_type];
+       gc2 = style->dark_gc[state_type];
+       gc3 = NULL;
+       gc4 = NULL;
+       break;
+      case GTK_SHADOW_ETCHED_OUT:
+       gc1 = style->dark_gc[state_type];
+       gc2 = style->light_gc[state_type];
+       gc3 = NULL;
+       gc4 = NULL;
+       break;
+      default:
+       return;
+     }
+   
+   if ((width == -1) && (height == -1))
+     gdk_window_get_size (window, &width, &height);
+   else if (width == -1)
+     gdk_window_get_size (window, &width, NULL);
+   else if (height == -1)
+     gdk_window_get_size (window, NULL, &height);
+   
+   half_width = width / 2;
+   half_height = height / 2;
+   
+   if (area)
+     {
+       gdk_gc_set_clip_rectangle (gc1, area);
+       gdk_gc_set_clip_rectangle (gc2, area);
+       if ((gc3) && (gc4))
+         {
+            gdk_gc_set_clip_rectangle (gc3, area);
+            gdk_gc_set_clip_rectangle (gc4, area);
+         }
+     }
+
+   switch (arrow_type)
+     {
+      case GTK_ARROW_UP:
+       if (fill)
+         {
+            points[0].x = x + half_width;
+            points[0].y = y;
+            points[1].x = x;
+            points[1].y = y + height - 1;
+            points[2].x = x + width - 1;
+            points[2].y = y + height - 1;
+            
+            gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, points, 3);
+         }
+       
+       switch (shadow_type)
+         {
+          case GTK_SHADOW_IN:
+          case GTK_SHADOW_OUT:
+            
+            gdk_draw_line (window, gc1,
+                           x + 1, y + height - 2,
+                           x + width - 2, y + height - 2);
+            gdk_draw_line (window, gc3,
+                           x + 0, y + height - 1,
+                           x + width - 1, y + height - 1);
+            
+            gdk_draw_line (window, gc1,
+                           x + width - 2, y + height - 1,
+                           x + half_width, y + 1);
+            gdk_draw_line (window, gc3,
+                           x + width - 1, y + height - 1,
+                           x + half_width, y);
+            
+            gdk_draw_line (window, gc4,
+                           x + half_width, y + 1,
+                           x + 1, y + height - 1);
+            gdk_draw_line (window, gc2,
+                           x + half_width, y,
+                           x, y + height - 1);
+            break;
+            
+          case GTK_SHADOW_ETCHED_IN:
+          case GTK_SHADOW_ETCHED_OUT:
+            gdk_draw_line (window, gc1,
+                           x + half_width, y + 1,
+                           x + 1, y + height - 1);
+            gdk_draw_line (window, gc1,
+                           x + 1, y + height - 1,
+                           x + width - 1, y + height - 1);
+            gdk_draw_line (window, gc1,
+                           x + width - 1, y + height - 1,
+                           x + half_width + 1, y + 1);
+            
+            points[0].x = x + half_width;
+            points[0].y = y;
+            points[1].x = x;
+            points[1].y = y + height - 2;
+            points[2].x = x + width - 2;
+            points[2].y = y + height - 2;
+            
+            gdk_draw_polygon (window, gc2, FALSE, points, 3);
+            break;
+            
+          default:
+            break;
+         }
+       break;
+       
+      case GTK_ARROW_DOWN:
+       if (fill)
+         {
+            points[0].x = x + width - 1;
+            points[0].y = y;
+          points[1].x = x;
+            points[1].y = y;
+            points[2].x = x + half_width;
+            points[2].y = y + height - 1;
+            
+            gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, points, 3);
+         }
+       switch (shadow_type)
+         {
+          case GTK_SHADOW_IN:
+          case GTK_SHADOW_OUT:
+            gdk_draw_line (window, gc4,
+                           x + width - 2,
+                           y + 1, x + 1, y + 1);
+            gdk_draw_line (window, gc2,
+                           x + width - 1, y,
+                           x, y);
+            
+            gdk_draw_line (window, gc4,
+                           x + 1, y,
+                           x + half_width, y + height - 2);
+            gdk_draw_line (window, gc2,
+                           x, y,
+                           x + half_width, y + height - 1);
+            
+            gdk_draw_line (window, gc1,
+                           x + half_width, y + height - 2,
+                           x + width - 2, y);
+            gdk_draw_line (window, gc3,
+                           x + half_width, y + height - 1,
+                           x + width - 1, y);
+            break;
+            
+          case GTK_SHADOW_ETCHED_IN:
+          case GTK_SHADOW_ETCHED_OUT:
+            gdk_draw_line (window, gc1,
+                           x + width - 1, y + 1,
+                           x + 1, y + 1);
+            gdk_draw_line (window, gc1,
+                           x + 1, y + 1,
+                           x + half_width + 1, y + height - 1);
+            gdk_draw_line (window, gc1,
+                           x + half_width + 1, y + height - 2,
+                           x + width - 1, y);
+            
+            points[0].x = x + width - 2;
+            points[0].y = y;
+            points[1].x = x;
+            points[1].y = y;
+            points[2].x = x + half_width;
+            points[2].y = y + height - 2;
+            
+            gdk_draw_polygon (window, gc2, FALSE, points, 3);
+            break;
+            
+          default:
+            break;
+         }
+       break;
+      case GTK_ARROW_LEFT:
+      if (fill)
+         {
+            points[0].x = x;
+            points[0].y = y + half_height;
+            points[1].x = x + width - 1;
+            points[1].y = y + height - 1;
+            points[2].x = x + width - 1;
+            points[2].y = y;
+            
+            gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, points, 3);
+         }
+       
+       switch (shadow_type)
+         {
+          case GTK_SHADOW_IN:
+          case GTK_SHADOW_OUT:
+            gdk_draw_line (window, gc1,
+                           x + 1, y + half_height,
+                           x + width - 1, y + height - 1);
+            gdk_draw_line (window, gc3,
+                           x, y + half_height,
+                           x + width - 1, y + height - 1);
+            
+            gdk_draw_line (window, gc1,
+                           x + width - 2, y + height - 1,
+                           x + width - 2, y + 1);
+            gdk_draw_line (window, gc3,
+                           x + width - 1, y + height - 1,
+                           x + width - 1, y);
+            
+            gdk_draw_line (window, gc4,
+                           x + width - 1, y + 1,
+                           x + 1, y + half_height);
+            gdk_draw_line (window, gc2,
+                           x + width - 1, y,
+                           x, y + half_height);
+            break;
+            
+          case GTK_SHADOW_ETCHED_IN:
+          case GTK_SHADOW_ETCHED_OUT:
+            gdk_draw_line (window, gc1,
+                           x + width - 1, y + 1,
+                           x + 1, y + half_height);
+            gdk_draw_line (window, gc1,
+                           x + 1, y + half_height + 1,
+                           x + width - 1, y + height - 1);
+            gdk_draw_line (window, gc1,
+                           x + width - 1, y + height - 1,
+                           x + width - 1, y + 1);
+            
+            points[0].x = x + width - 2;
+            points[0].y = y;
+            points[1].x = x;
+            points[1].y = y + half_height;
+            points[2].x = x + width - 2;
+            points[2].y = y + height - 2;
+            
+            gdk_draw_polygon (window, gc2, FALSE, points, 3);
+            break;
+            
+          default:
+            break;
+         }
+       break;
+      case GTK_ARROW_RIGHT:
+       if (fill)
+         {
+            points[0].x = x + width - 1;
+            points[0].y = y + half_height;
+            points[1].x = x;
+            points[1].y = y;
+            points[2].x = x;
+            points[2].y = y + height - 1;
+            
+            gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, points, 3);
+         }
+       
+       switch (shadow_type)
+         {
+          case GTK_SHADOW_IN:
+          case GTK_SHADOW_OUT:
+            gdk_draw_line (window, gc4,
+                           x + width - 1, y + half_height,
+                           x + 1, y + 1);
+            gdk_draw_line (window, gc2,
+                           x + width - 1, y + half_height,
+                           x, y);
+            gdk_draw_line (window, gc4,
+                           x + 1, y + 1,
+                           x + 1, y + height - 2);
+            gdk_draw_line (window, gc2,
+                           x, y,
+                           x, y + height - 1);
+            
+            gdk_draw_line (window, gc1,
+                           x + 1, y + height - 2,
+                           x + width - 1, y + half_height);
+            gdk_draw_line (window, gc3,
+                           x, y + height - 1,
+                           x + width - 1, y + half_height);
+            break;
+            
+          case GTK_SHADOW_ETCHED_IN:
+       case GTK_SHADOW_ETCHED_OUT:
+            gdk_draw_line (window, gc1,
+                           x + width - 1, y + half_height + 1,
+                           x + 1, y + 1);
+            gdk_draw_line (window, gc1,
+                           x + 1, y + 1,
+                           x + 1, y + height - 1);
+            gdk_draw_line (window, gc1,
+                           x + 1, y + height - 1,
+                           x + width - 1, y + half_height + 1);
+            
+            points[0].x = x + width - 2;
+            points[0].y = y + half_height;
+            points[1].x = x;
+            points[1].y = y;
+            points[2].x = x;
+            points[2].y = y + height - 1;
+            
+            gdk_draw_polygon (window, gc2, FALSE, points, 3);
+            break;
+            
+          default:
+            break;
+         }
+       break;
+     }
+   if (area)
+     {
+       gdk_gc_set_clip_rectangle (gc1, NULL);
+       gdk_gc_set_clip_rectangle (gc2, NULL);
+       if (gc3)
+         {
+            gdk_gc_set_clip_rectangle (gc3, NULL);
+            gdk_gc_set_clip_rectangle (gc4, NULL);
+         }
+     }
+}
+
+static void
+gtk_default_draw_diamond (GtkStyle      *style,
+                         GdkWindow     *window,
+                         GtkStateType   state_type,
+                         GtkShadowType  shadow_type,
+                         GdkRectangle  *area,
+                         GtkWidget     *widget,
+                         gchar         *detail,
+                         gint           x,
+                         gint           y,
+                         gint           width,
+                         gint           height)
+{
+   gint half_width;
+   gint half_height;
+   
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (window != NULL);
+   
+   if ((width == -1) && (height == -1))
+     gdk_window_get_size (window, &width, &height);
+   else if (width == -1)
+     gdk_window_get_size (window, &width, NULL);
+   else if (height == -1)
+     gdk_window_get_size (window, NULL, &height);
+   
+   half_width = width / 2;
+   half_height = height / 2;
+   
+   if (area)
+     {
+       gdk_gc_set_clip_rectangle (style->light_gc[state_type], area);
+       gdk_gc_set_clip_rectangle (style->bg_gc[state_type], area);
+       gdk_gc_set_clip_rectangle (style->dark_gc[state_type], area);
+       gdk_gc_set_clip_rectangle (style->black_gc, area);
+     }
+   switch (shadow_type)
+     {
+      case GTK_SHADOW_IN:
+       gdk_draw_line (window, style->bg_gc[state_type],
+                      x + 2, y + half_height,
+                      x + half_width, y + height - 2);
+       gdk_draw_line (window, style->bg_gc[state_type],
+                      x + half_width, y + height - 2,
+                      x + width - 2, y + half_height);
+       gdk_draw_line (window, style->light_gc[state_type],
+                      x + 1, y + half_height,
+                      x + half_width, y + height - 1);
+       gdk_draw_line (window, style->light_gc[state_type],
+                      x + half_width, y + height - 1,
+                      x + width - 1, y + half_height);
+       gdk_draw_line (window, style->light_gc[state_type],
+                      x, y + half_height,
+                      x + half_width, y + height);
+       gdk_draw_line (window, style->light_gc[state_type],
+                      x + half_width, y + height,
+                     x + width, y + half_height);
+       
+       gdk_draw_line (window, style->black_gc,
+                      x + 2, y + half_height,
+                      x + half_width, y + 2);
+       gdk_draw_line (window, style->black_gc,
+                      x + half_width, y + 2,
+                      x + width - 2, y + half_height);
+       gdk_draw_line (window, style->dark_gc[state_type],
+                      x + 1, y + half_height,
+                     x + half_width, y + 1);
+       gdk_draw_line (window, style->dark_gc[state_type],
+                      x + half_width, y + 1,
+                      x + width - 1, y + half_height);
+       gdk_draw_line (window, style->dark_gc[state_type],
+                      x, y + half_height,
+                      x + half_width, y);
+       gdk_draw_line (window, style->dark_gc[state_type],
+                      x + half_width, y,
+                      x + width, y + half_height);
+       break;
+      case GTK_SHADOW_OUT:
+       gdk_draw_line (window, style->dark_gc[state_type],
+                      x + 2, y + half_height,
+                      x + half_width, y + height - 2);
+       gdk_draw_line (window, style->dark_gc[state_type],
+                      x + half_width, y + height - 2,
+                      x + width - 2, y + half_height);
+       gdk_draw_line (window, style->dark_gc[state_type],
+                      x + 1, y + half_height,
+                      x + half_width, y + height - 1);
+       gdk_draw_line (window, style->dark_gc[state_type],
+                      x + half_width, y + height - 1,
+                      x + width - 1, y + half_height);
+       gdk_draw_line (window, style->black_gc,
+                      x, y + half_height,
+                      x + half_width, y + height);
+       gdk_draw_line (window, style->black_gc,
+                      x + half_width, y + height,
+                      x + width, y + half_height);
+       
+       gdk_draw_line (window, style->bg_gc[state_type],
+                      x + 2, y + half_height,
+                      x + half_width, y + 2);
+       gdk_draw_line (window, style->bg_gc[state_type],
+                      x + half_width, y + 2,
+                      x + width - 2, y + half_height);
+       gdk_draw_line (window, style->light_gc[state_type],
+                      x + 1, y + half_height,
+                      x + half_width, y + 1);
+       gdk_draw_line (window, style->light_gc[state_type],
+                      x + half_width, y + 1,
+                     x + width - 1, y + half_height);
+       gdk_draw_line (window, style->light_gc[state_type],
+                      x, y + half_height,
+                      x + half_width, y);
+       gdk_draw_line (window, style->light_gc[state_type],
+                      x + half_width, y,
+                      x + width, y + half_height);
+       break;
+      default:
+       break;
+     }
+   if (area)
+     {
+       gdk_gc_set_clip_rectangle (style->light_gc[state_type], NULL);
+       gdk_gc_set_clip_rectangle (style->bg_gc[state_type], NULL);
+       gdk_gc_set_clip_rectangle (style->dark_gc[state_type], NULL);
+       gdk_gc_set_clip_rectangle (style->black_gc, NULL);
+     }
+}
 
+
+static void
+gtk_default_draw_oval (GtkStyle      *style,
+                      GdkWindow     *window,
+                      GtkStateType   state_type,
+                      GtkShadowType  shadow_type,
+                      GdkRectangle  *area,
+                      GtkWidget     *widget,
+                      gchar         *detail,
+                      gint           x,
+                      gint           y,
+                      gint           width,
+                      gint           height)
+{
   g_return_if_fail (style != NULL);
   g_return_if_fail (window != NULL);
+}
 
-  switch (shadow_type)
-    {
-    case GTK_SHADOW_IN:
-      gc1 = style->bg_gc[state_type];
-      gc2 = style->dark_gc[state_type];
-      gc3 = style->light_gc[state_type];
-      gc4 = style->black_gc;
-      break;
-    case GTK_SHADOW_OUT:
-      gc1 = style->dark_gc[state_type];
-      gc2 = style->light_gc[state_type];
-      gc3 = style->black_gc;
-      gc4 = style->bg_gc[state_type];
-      break;
-    case GTK_SHADOW_ETCHED_IN:
-      gc1 = style->light_gc[state_type];
-      gc2 = style->dark_gc[state_type];
-      gc3 = NULL;
-      gc4 = NULL;
-      break;
-    case GTK_SHADOW_ETCHED_OUT:
-      gc1 = style->dark_gc[state_type];
-      gc2 = style->light_gc[state_type];
-      gc3 = NULL;
-      gc4 = NULL;
-      break;
-    default:
-      return;
-    }
+static void
+gtk_default_draw_string (GtkStyle      *style,
+                        GdkWindow     *window,
+                        GtkStateType   state_type,
+                        GdkRectangle  *area,
+                        GtkWidget     *widget,
+                        gchar         *detail,
+                        gint           x,
+                        gint           y,
+                        const gchar   *string)
+{
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (window != NULL);
 
-  if ((width == -1) && (height == -1))
+   if (area)
+     {
+       gdk_gc_set_clip_rectangle (style->white_gc, area);
+       gdk_gc_set_clip_rectangle (style->fg_gc[state_type], area);
+     }
+   if (state_type == GTK_STATE_INSENSITIVE)
+     gdk_draw_string (window, style->font, style->white_gc, x + 1, y + 1, string);
+   gdk_draw_string (window, style->font, style->fg_gc[state_type], x, y, string);
+   if (area)
+     {
+       gdk_gc_set_clip_rectangle (style->white_gc, NULL);
+       gdk_gc_set_clip_rectangle (style->fg_gc[state_type], NULL);
+     }
+}
+
+static void 
+gtk_default_draw_box     (GtkStyle      *style,
+                         GdkWindow     *window,
+                         GtkStateType   state_type,
+                         GtkShadowType  shadow_type,
+                         GdkRectangle  *area,
+                         GtkWidget     *widget,
+                         gchar         *detail,
+                         gint           x,
+                         gint           y,
+                         gint           width,
+                         gint           height)
+{
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (window != NULL);
+   
+   if ((width == -1) && (height == -1))
+     gdk_window_get_size (window, &width, &height);
+   else if (width == -1)
+     gdk_window_get_size (window, &width, NULL);
+   else if (height == -1)
+     gdk_window_get_size (window, NULL, &height);
+
+  if ((!style->bg_pixmap[state_type]) || 
+      (gdk_window_get_type(window) == GDK_WINDOW_PIXMAP))
+    {
+      if (area)
+       {
+         gdk_gc_set_clip_rectangle (style->bg_gc[state_type], area);
+       }
+      gdk_draw_rectangle(window, style->bg_gc[state_type], TRUE,
+                        x, y, width, height);
+      if (area)
+       {
+         gdk_gc_set_clip_rectangle (style->bg_gc[state_type], NULL);
+       }
+    }
+  else
+    gtk_style_apply_default_pixmap(style, window, state_type, area, x, y, width, height);
+  gtk_paint_shadow (style, window, state_type, shadow_type, area, widget, detail,
+                   x, y, width, height);
+}
+
+static void 
+gtk_default_draw_flat_box (GtkStyle      *style,
+                          GdkWindow     *window,
+                          GtkStateType   state_type,
+                          GtkShadowType  shadow_type,
+                          GdkRectangle  *area,
+                          GtkWidget     *widget,
+                          gchar         *detail,
+                          gint           x,
+                          gint           y,
+                          gint           width,
+                          gint           height)
+{
+  GdkGC *gc1;
+   
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (window != NULL);
+   
+  if ((width == -1) && (height == -1))
     gdk_window_get_size (window, &width, &height);
   else if (width == -1)
     gdk_window_get_size (window, &width, NULL);
   else if (height == -1)
     gdk_window_get_size (window, NULL, &height);
+   
+  if ((detail) && (!strcmp("text",detail)) && (state_type == GTK_STATE_SELECTED))
+    gc1 = style->bg_gc[GTK_STATE_SELECTED];
+  else if ((detail) && (!strcmp("viewportbin",detail)))
+    gc1 = style->bg_gc[GTK_STATE_NORMAL];
+  else if ((detail) && (!strcmp("entry_bg",detail)))
+    gc1 = style->base_gc[state_type];
+  else
+    gc1 = style->bg_gc[state_type];
 
-  half_width = width / 2;
-  half_height = height / 2;
-
-  switch (arrow_type)
+  if ((!style->bg_pixmap[state_type]) || (gc1 != style->bg_gc[state_type]) ||
+      (gdk_window_get_type(window) == GDK_WINDOW_PIXMAP))
     {
-    case GTK_ARROW_UP:
-      if (fill)
-        {
-          points[0].x = x + half_width;
-          points[0].y = y;
-          points[1].x = x;
-          points[1].y = y + height - 1;
-          points[2].x = x + width - 1;
-          points[2].y = y + height - 1;
+      if (area)
+       {
+         gdk_gc_set_clip_rectangle (gc1, area);
+       }
+      gdk_draw_rectangle (window, gc1, TRUE,
+                         x, y, width, height);
+      if ((detail) && (!strcmp("tooltip",detail)))
+       gdk_draw_rectangle (window, style->black_gc, FALSE,
+                           x, y, width - 1, height - 1);
+      if (area)
+       {
+         gdk_gc_set_clip_rectangle (gc1, NULL);
+       }
+    }
+  else
+    gtk_style_apply_default_pixmap(style, window, state_type, area, x, y, width, height);
+}
 
-          gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, points, 3);
-        }
+static void 
+gtk_default_draw_check   (GtkStyle      *style,
+                         GdkWindow     *window,
+                         GtkStateType   state_type,
+                         GtkShadowType  shadow_type,
+                         GdkRectangle  *area,
+                         GtkWidget     *widget,
+                         gchar         *detail,
+                         gint           x,
+                         gint           y,
+                         gint           width,
+                         gint           height)
+{
+   gtk_paint_box (style, window, state_type, shadow_type, area, widget, detail,
+                 x, y, width, height);
+}
+
+static void 
+gtk_default_draw_option  (GtkStyle      *style,
+                         GdkWindow     *window,
+                         GtkStateType   state_type,
+                         GtkShadowType  shadow_type,
+                         GdkRectangle  *area,
+                         GtkWidget     *widget,
+                         gchar         *detail,
+                         gint           x,
+                         gint           y,
+                         gint           width,
+                         gint           height)
+{
+   gtk_paint_diamond (style, window, state_type, shadow_type, area, widget, 
+                    detail, x, y, width, height);
+}
+
+static void 
+gtk_default_draw_cross   (GtkStyle      *style,
+                         GdkWindow     *window,
+                         GtkStateType   state_type,
+                         GtkShadowType  shadow_type,
+                         GdkRectangle  *area,
+                         GtkWidget     *widget,
+                         gchar         *detail,
+                         gint           x,
+                         gint           y,
+                         gint           width,
+                         gint           height)
+{
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (window != NULL);
+}
+
+static void 
+gtk_default_draw_ramp    (GtkStyle      *style,
+                         GdkWindow     *window,
+                         GtkStateType   state_type,
+                         GtkShadowType  shadow_type,
+                         GdkRectangle  *area,
+                         GtkWidget     *widget,
+                         gchar         *detail,
+                         GtkArrowType   arrow_type,
+                         gint           x,
+                         gint           y,
+                         gint           width,
+                         gint           height)
+{
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (window != NULL);
+}
+
+static void gtk_default_draw_tab     (GtkStyle      *style,
+                                     GdkWindow     *window,
+                                     GtkStateType   state_type,
+                                     GtkShadowType  shadow_type,
+                                     GdkRectangle  *area,
+                                     GtkWidget     *widget,
+                                     gchar         *detail,
+                                     gint           x,
+                                     gint           y,
+                                     gint           width,
+                                     gint           height)
+{
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (window != NULL);
+
+   gtk_paint_box (style, window, state_type, shadow_type, area, widget, detail,
+                     x, y, width, height);
+}
+
+static void 
+gtk_default_draw_shadow_gap (GtkStyle       *style,
+                            GdkWindow      *window,
+                            GtkStateType    state_type,
+                            GtkShadowType   shadow_type,
+                            GdkRectangle   *area,
+                            GtkWidget      *widget,
+                            gchar          *detail,
+                            gint            x,
+                            gint            y,
+                            gint            width,
+                            gint            height,
+                            GtkPositionType gap_side,
+                            gint            gap_x,
+                            gint            gap_width)
+{
+  GdkGC *gc1 = NULL;
+  GdkGC *gc2 = NULL;
+  GdkGC *gc3 = NULL;
+  GdkGC *gc4 = NULL;
+
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (window != NULL);
+
+  if ((width == -1) && (height == -1))
+    gdk_window_get_size (window, &width, &height);
+  else if (width == -1)
+    gdk_window_get_size (window, &width, NULL);
+  else if (height == -1)
+    gdk_window_get_size (window, NULL, &height);
 
-      switch (shadow_type)
+  switch (shadow_type)
+    {
+     case GTK_SHADOW_NONE:
+      return;
+     case GTK_SHADOW_IN:
+      gc1 = style->dark_gc[state_type];
+      gc2 = style->black_gc;
+      gc3 = style->bg_gc[state_type];
+      gc4 = style->light_gc[state_type];
+      break;
+     case GTK_SHADOW_ETCHED_IN:
+      gc1 = style->dark_gc[state_type];
+      gc2 = style->light_gc[state_type];
+      gc3 = style->dark_gc[state_type];
+      gc4 = style->light_gc[state_type];
+      break;
+     case GTK_SHADOW_OUT:
+      gc1 = style->light_gc[state_type];
+      gc2 = style->bg_gc[state_type];
+      gc3 = style->dark_gc[state_type];
+      gc4 = style->black_gc;
+      break;
+     case GTK_SHADOW_ETCHED_OUT:
+      gc1 = style->light_gc[state_type];
+      gc2 = style->dark_gc[state_type];
+      gc3 = style->light_gc[state_type];
+      gc4 = style->dark_gc[state_type];
+      break;
+    }
+  if (area)
+    {
+      gdk_gc_set_clip_rectangle (gc1, area);
+      gdk_gc_set_clip_rectangle (gc2, area);
+      gdk_gc_set_clip_rectangle (gc3, area);
+      gdk_gc_set_clip_rectangle (gc4, area);
+    }
+
+  switch (shadow_type)
+    {
+    case GTK_SHADOW_NONE:
+    case GTK_SHADOW_IN:
+    case GTK_SHADOW_OUT:
+    case GTK_SHADOW_ETCHED_IN:
+    case GTK_SHADOW_ETCHED_OUT:
+      switch (gap_side)
        {
-       case GTK_SHADOW_IN:
-       case GTK_SHADOW_OUT:
-         
+       case GTK_POS_TOP:
          gdk_draw_line (window, gc1,
-                        x + 1, y + height - 2,
-                        x + width - 2, y + height - 2);
-         gdk_draw_line (window, gc3,
-                        x + 0, y + height - 1,
-                        x + width - 1, y + height - 1);
+                        x, y, x, y + height - 1);
+         gdk_draw_line (window, gc2,
+                        x + 1, y, x + 1, y + height - 2);
          
-         gdk_draw_line (window, gc1,
-                        x + width - 2, y + height - 1,
-                        x + half_width, y + 1);
          gdk_draw_line (window, gc3,
-                        x + width - 1, y + height - 1,
-                        x + half_width, y);
-         
+                        x + 1, y + height - 2, x + width - 2, y + height - 2);
+         gdk_draw_line (window, gc3,
+                        x + width - 2, y, x + width - 2, y + height - 2);
          gdk_draw_line (window, gc4,
-                        x + half_width, y + 1,
-                        x + 1, y + height - 1);
-         gdk_draw_line (window, gc2,
-                        x + half_width, y,
-                        x, y + height - 1);
+                        x, y + height - 1, x + width - 1, y + height - 1);
+         gdk_draw_line (window, gc4,
+                        x + width - 1, y, x + width - 1, y + height - 1);
+         if (gap_x > 0)
+           {
+             gdk_draw_line (window, gc1,
+                            x, y, x + gap_x - 1, y);
+             gdk_draw_line (window, gc2,
+                            x + 1, y + 1, x + gap_x - 1, y + 1);
+             gdk_draw_line (window, gc2,
+                            x + gap_x, y, x + gap_x, y);
+           }
+         if ((width - (gap_x + gap_width)) > 0)
+           {
+             gdk_draw_line (window, gc1,
+                            x + gap_x + gap_width, y, x + width - 2, y);
+             gdk_draw_line (window, gc2,
+                            x + gap_x + gap_width, y + 1, x + width - 2, y + 1);
+             gdk_draw_line (window, gc2,
+                            x + gap_x + gap_width - 1, y, x + gap_x + gap_width - 1, y);
+           }
          break;
-
-       case GTK_SHADOW_ETCHED_IN:
-       case GTK_SHADOW_ETCHED_OUT:
+       case GTK_POS_BOTTOM:
          gdk_draw_line (window, gc1,
-                        x + half_width, y + 1,
-                        x + 1, y + height - 1);
+                        x, y, x + width - 1, y);
          gdk_draw_line (window, gc1,
-                        x + 1, y + height - 1,
-                        x + width - 1, y + height - 1);
-         gdk_draw_line (window, gc1,
-                        x + width - 1, y + height - 1,
-                        x + half_width + 1, y + 1);
-         
-          points[0].x = x + half_width;
-          points[0].y = y;
-          points[1].x = x;
-          points[1].y = y + height - 2;
-          points[2].x = x + width - 2;
-          points[2].y = y + height - 2;
-
-          gdk_draw_polygon (window, gc2, FALSE, points, 3);
-         break;
+                        x, y, x, y + height - 1);
+         gdk_draw_line (window, gc2,
+                        x + 1, y + 1, x + width - 2, y + 1);
+         gdk_draw_line (window, gc2,
+                        x + 1, y + 1, x + 1, y + height - 1);
 
-       default:
+         gdk_draw_line (window, gc3,
+                        x + width - 2, y + 1, x + width - 2, y + height - 1);
+         gdk_draw_line (window, gc4,
+                        x + width - 1, y, x + width - 1, y + height - 1);
+         if (gap_x > 0)
+           {
+             gdk_draw_line (window, gc4,
+                            x, y + height - 1, x + gap_x - 1, y + height - 1);
+             gdk_draw_line (window, gc3,
+                            x + 1, y + height - 2, x + gap_x - 1, y + height - 2);
+             gdk_draw_line (window, gc3,
+                            x + gap_x, y + height - 1, x + gap_x, y + height - 1);
+           }
+         if ((width - (gap_x + gap_width)) > 0)
+           {
+             gdk_draw_line (window, gc4,
+                            x + gap_x + gap_width, y + height - 1, x + width - 2, y + height - 1);
+             gdk_draw_line (window, gc3,
+                            x + gap_x + gap_width, y + height - 2, x + width - 2, y + height - 2);
+             gdk_draw_line (window, gc3,
+                            x + gap_x + gap_width - 1, y + height - 1, x + gap_x + gap_width - 1, y + height - 1);
+           }
          break;
-       }
-      break;
-
-    case GTK_ARROW_DOWN:
-      if (fill)
-        {
-          points[0].x = x + width - 1;
-          points[0].y = y;
-          points[1].x = x;
-          points[1].y = y;
-          points[2].x = x + half_width;
-          points[2].y = y + height - 1;
+       case GTK_POS_LEFT:
+         gdk_draw_line (window, gc1,
+                        x, y, x + width - 1, y);
+         gdk_draw_line (window, gc2,
+                        x, y + 1, x + width - 2, y + 1);
 
-          gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, points, 3);
-        }
-      switch (shadow_type)
-       {
-       case GTK_SHADOW_IN:
-       case GTK_SHADOW_OUT:
+         gdk_draw_line (window, gc3,
+                        x, y + height - 2, x + width - 2, y + height - 2);
+         gdk_draw_line (window, gc3,
+                        x + width - 2, y + 1, x + width - 2, y + height - 2);
          gdk_draw_line (window, gc4,
-                        x + width - 2,
-                        y + 1, x + 1, y + 1);
-         gdk_draw_line (window, gc2,
-                        x + width - 1, y,
-                        x, y);
-         
+                        x, y + height - 1, x + width - 1, y + height - 1);
          gdk_draw_line (window, gc4,
-                        x + 1, y,
-                        x + half_width, y + height - 2);
+                        x + width - 1, y, x + width - 1, y + height - 1);
+         if (gap_x > 0)
+           {
+             gdk_draw_line (window, gc1,
+                            x, y, x, y + gap_x - 1);
+             gdk_draw_line (window, gc2,
+                            x + 1, y + 1, x + 1, y + gap_x - 1);
+             gdk_draw_line (window, gc2,
+                            x, y + gap_x, x, y + gap_x);
+           }
+         if ((width - (gap_x + gap_width)) > 0)
+           {
+             gdk_draw_line (window, gc1,
+                            x, y + gap_x + gap_width, x, y + height - 2);
+             gdk_draw_line (window, gc2,
+                            x + 1, y + gap_x + gap_width, x + 1, y + height - 2);
+             gdk_draw_line (window, gc2,
+                            x, y + gap_x + gap_width - 1, x, y + gap_x + gap_width - 1);
+           }
+         break;
+       case GTK_POS_RIGHT:
+         gdk_draw_line (window, gc1,
+                        x, y, x + width - 1, y);
+         gdk_draw_line (window, gc1,
+                        x, y, x, y + height - 1);
+         gdk_draw_line (window, gc2,
+                        x + 1, y + 1, x + width - 1, y + 1);
          gdk_draw_line (window, gc2,
-                        x, y,
-                        x + half_width, y + height - 1);
+                        x + 1, y + 1, x + 1, y + height - 2);
 
-         gdk_draw_line (window, gc1,
-                        x + half_width, y + height - 2,
-                        x + width - 2, y);
          gdk_draw_line (window, gc3,
-                        x + half_width, y + height - 1,
-                        x + width - 1, y);
+                        x + 1, y + height - 2, x + width - 1, y + height - 2);
+         gdk_draw_line (window, gc4,
+                        x, y + height - 1, x + width - 1, y + height - 1);
+         if (gap_x > 0)
+           {
+             gdk_draw_line (window, gc4,
+                            x + width - 1, y, x + width - 1, y + gap_x - 1);
+             gdk_draw_line (window, gc3,
+                            x + width - 2, y + 1, x + width - 2, y + gap_x - 1);
+             gdk_draw_line (window, gc3,
+                            x + width - 1, y + gap_x, x + width - 1, y + gap_x);
+           }
+         if ((width - (gap_x + gap_width)) > 0)
+           {
+             gdk_draw_line (window, gc4,
+                            x + width - 1, y + gap_x + gap_width, x + width - 1, y + height - 2);
+             gdk_draw_line (window, gc3,
+                            x + width - 2, y + gap_x + gap_width, x + width - 2, y + height - 2);
+             gdk_draw_line (window, gc3,
+                            x + width - 1, y + gap_x + gap_width - 1, x + width - 1, y + gap_x + gap_width - 1);
+           }
          break;
+       }
+    }
+  if (area)
+    {
+      gdk_gc_set_clip_rectangle (gc1, NULL);
+      gdk_gc_set_clip_rectangle (gc2, NULL);
+      gdk_gc_set_clip_rectangle (gc3, NULL);
+      gdk_gc_set_clip_rectangle (gc4, NULL);
+    }
+}
 
-       case GTK_SHADOW_ETCHED_IN:
-       case GTK_SHADOW_ETCHED_OUT:
-         gdk_draw_line (window, gc1,
-                        x + width - 1, y + 1,
-                        x + 1, y + 1);
-         gdk_draw_line (window, gc1,
-                        x + 1, y + 1,
-                        x + half_width + 1, y + height - 1);
-         gdk_draw_line (window, gc1,
-                        x + half_width + 1, y + height - 2,
-                        x + width - 1, y);
-         
-          points[0].x = x + width - 2;
-          points[0].y = y;
-          points[1].x = x;
-          points[1].y = y;
-          points[2].x = x + half_width;
-          points[2].y = y + height - 2;
+static void 
+gtk_default_draw_box_gap (GtkStyle       *style,
+                         GdkWindow      *window,
+                         GtkStateType    state_type,
+                         GtkShadowType   shadow_type,
+                         GdkRectangle   *area,
+                         GtkWidget      *widget,
+                         gchar          *detail,
+                         gint            x,
+                         gint            y,
+                         gint            width,
+                         gint            height,
+                         GtkPositionType gap_side,
+                         gint            gap_x,
+                         gint            gap_width)
+{
+  GdkGC *gc1 = NULL;
+  GdkGC *gc2 = NULL;
+  GdkGC *gc3 = NULL;
+  GdkGC *gc4 = NULL;
 
-          gdk_draw_polygon (window, gc2, FALSE, points, 3);
-         break;
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (window != NULL);
 
-       default:
-         break;
-       }
+  gtk_style_apply_default_pixmap(style, window, state_type, area,
+                                x, y, width, height);
+
+  if ((width == -1) && (height == -1))
+    gdk_window_get_size (window, &width, &height);
+  else if (width == -1)
+    gdk_window_get_size (window, &width, NULL);
+  else if (height == -1)
+    gdk_window_get_size (window, NULL, &height);
+
+  switch (shadow_type)
+    {
+     case GTK_SHADOW_NONE:
+      return;
+     case GTK_SHADOW_IN:
+      gc1 = style->dark_gc[state_type];
+      gc2 = style->black_gc;
+      gc3 = style->bg_gc[state_type];
+      gc4 = style->light_gc[state_type];
       break;
-    case GTK_ARROW_LEFT:
-      if (fill)
-        {
-          points[0].x = x;
-          points[0].y = y + half_height;
-          points[1].x = x + width - 1;
-          points[1].y = y + height - 1;
-          points[2].x = x + width - 1;
-          points[2].y = y;
-
-          gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, points, 3);
-        }
+     case GTK_SHADOW_ETCHED_IN:
+      gc1 = style->dark_gc[state_type];
+      gc2 = style->light_gc[state_type];
+      gc3 = style->dark_gc[state_type];
+      gc4 = style->light_gc[state_type];
+      break;
+     case GTK_SHADOW_OUT:
+      gc1 = style->light_gc[state_type];
+      gc2 = style->bg_gc[state_type];
+      gc3 = style->dark_gc[state_type];
+      gc4 = style->black_gc;
+      break;
+     case GTK_SHADOW_ETCHED_OUT:
+      gc1 = style->light_gc[state_type];
+      gc2 = style->dark_gc[state_type];
+      gc3 = style->light_gc[state_type];
+      gc4 = style->dark_gc[state_type];
+      break;
+    }
+  if (area)
+    {
+      gdk_gc_set_clip_rectangle (gc1, area);
+      gdk_gc_set_clip_rectangle (gc2, area);
+      gdk_gc_set_clip_rectangle (gc3, area);
+      gdk_gc_set_clip_rectangle (gc4, area);
+    }
 
-      switch (shadow_type)
+  switch (shadow_type)
+    {
+    case GTK_SHADOW_NONE:
+    case GTK_SHADOW_IN:
+    case GTK_SHADOW_OUT:
+    case GTK_SHADOW_ETCHED_IN:
+    case GTK_SHADOW_ETCHED_OUT:
+      if (gap_side == 0)
+       /* top */
        {
-       case GTK_SHADOW_IN:
-       case GTK_SHADOW_OUT:
          gdk_draw_line (window, gc1,
-                        x + 1, y + half_height,
-                        x + width - 1, y + height - 1);
-         gdk_draw_line (window, gc3,
-                        x, y + half_height,
-                        x + width - 1, y + height - 1);
+                        x, y, x, y + height - 1);
+         gdk_draw_line (window, gc2,
+                        x + 1, y, x + 1, y + height - 2);
 
-         gdk_draw_line (window, gc1,
-                        x + width - 2, y + height - 1,
-                        x + width - 2, y + 1);
          gdk_draw_line (window, gc3,
-                        x + width - 1, y + height - 1,
-                        x + width - 1, y);
-
+                        x + 1, y + height - 2, x + width - 2, y + height - 2);
+         gdk_draw_line (window, gc3,
+                        x + width - 2, y, x + width - 2, y + height - 2);
          gdk_draw_line (window, gc4,
-                        x + width - 1, y + 1,
-                        x + 1, y + half_height);
-         gdk_draw_line (window, gc2,
-                        x + width - 1, y,
-                        x, y + half_height);
-         break;
-
-       case GTK_SHADOW_ETCHED_IN:
-       case GTK_SHADOW_ETCHED_OUT:
-         gdk_draw_line (window, gc1,
-                        x + width - 1, y + 1,
-                        x + 1, y + half_height);
-         gdk_draw_line (window, gc1,
-                        x + 1, y + half_height + 1,
-                        x + width - 1, y + height - 1);
-         gdk_draw_line (window, gc1,
-                        x + width - 1, y + height - 1,
-                        x + width - 1, y + 1);
-         
-          points[0].x = x + width - 2;
-          points[0].y = y;
-          points[1].x = x;
-          points[1].y = y + half_height;
-          points[2].x = x + width - 2;
-          points[2].y = y + height - 2;
-
-          gdk_draw_polygon (window, gc2, FALSE, points, 3);
-         break;
-
-       default:
-         break;
+                        x, y + height - 1, x + width - 1, y + height - 1);
+         gdk_draw_line (window, gc4,
+                        x + width - 1, y, x + width - 1, y + height - 1);
+         if (gap_x > 0)
+           {
+             gdk_draw_line (window, gc1,
+                            x, y, x + gap_x - 1, y);
+             gdk_draw_line (window, gc2,
+                            x + 1, y + 1, x + gap_x - 1, y + 1);
+             gdk_draw_line (window, gc2,
+                            x + gap_x, y, x + gap_x, y);
+           }
+         if ((width - (gap_x + gap_width)) > 0)
+           {
+             gdk_draw_line (window, gc1,
+                            x + gap_x + gap_width, y, x + width - 2, y);
+             gdk_draw_line (window, gc2,
+                            x + gap_x + gap_width, y + 1, x + width - 2, y + 1);
+             gdk_draw_line (window, gc2,
+                            x + gap_x + gap_width - 1, y, x + gap_x + gap_width - 1, y);
+           }
        }
-      break;
-    case GTK_ARROW_RIGHT:
-      if (fill)
-        {
-          points[0].x = x + width - 1;
-          points[0].y = y + half_height;
-          points[1].x = x;
-          points[1].y = y;
-          points[2].x = x;
-          points[2].y = y + height - 1;
-
-          gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, points, 3);
-        }
-
-      switch (shadow_type)
+      else if (gap_side == 1)
+       /* bottom */
        {
-       case GTK_SHADOW_IN:
-       case GTK_SHADOW_OUT:
-         gdk_draw_line (window, gc4,
-                        x + width - 1, y + half_height,
-                        x + 1, y + 1);
+         gdk_draw_line (window, gc1,
+                        x, y, x + width - 1, y);
+         gdk_draw_line (window, gc1,
+                        x, y, x, y + height - 1);
+         gdk_draw_line (window, gc2,
+                        x + 1, y + 1, x + width - 2, y + 1);
          gdk_draw_line (window, gc2,
-                        x + width - 1, y + half_height,
-                        x, y);
+                        x + 1, y + 1, x + 1, y + height - 1);
 
+         gdk_draw_line (window, gc3,
+                        x + width - 2, y + 1, x + width - 2, y + height - 1);
          gdk_draw_line (window, gc4,
-                        x + 1, y + 1,
-                        x + 1, y + height - 2);
+                        x + width - 1, y, x + width - 1, y + height - 1);
+         if (gap_x > 0)
+           {
+             gdk_draw_line (window, gc4,
+                            x, y + height - 1, x + gap_x - 1, y + height - 1);
+             gdk_draw_line (window, gc3,
+                            x + 1, y + height - 2, x + gap_x - 1, y + height - 2);
+             gdk_draw_line (window, gc3,
+                            x + gap_x, y + height - 1, x + gap_x, y + height - 1);
+           }
+         if ((width - (gap_x + gap_width)) > 0)
+           {
+             gdk_draw_line (window, gc4,
+                            x + gap_x + gap_width, y + height - 1, x + width - 2, y + height - 1);
+             gdk_draw_line (window, gc3,
+                            x + gap_x + gap_width, y + height - 2, x + width - 2, y + height - 2);
+             gdk_draw_line (window, gc3,
+                            x + gap_x + gap_width - 1, y + height - 1, x + gap_x + gap_width - 1, y + height - 1);
+           }
+       }
+      else if (gap_side == 2)
+       /* left */
+       {
+         gdk_draw_line (window, gc1,
+                        x, y, x + width - 1, y);
          gdk_draw_line (window, gc2,
-                        x, y,
-                        x, y + height - 1);
+                        x, y + 1, x + width - 2, y + 1);
 
-         gdk_draw_line (window, gc1,
-                        x + 1, y + height - 2,
-                        x + width - 1, y + half_height);
          gdk_draw_line (window, gc3,
-                        x, y + height - 1,
-                        x + width - 1, y + half_height);
-         break;
-
-       case GTK_SHADOW_ETCHED_IN:
-       case GTK_SHADOW_ETCHED_OUT:
-         gdk_draw_line (window, gc1,
-                        x + width - 1, y + half_height + 1,
-                        x + 1, y + 1);
+                        x, y + height - 2, x + width - 2, y + height - 2);
+         gdk_draw_line (window, gc3,
+                        x + width - 2, y + 1, x + width - 2, y + height - 2);
+         gdk_draw_line (window, gc4,
+                        x, y + height - 1, x + width - 1, y + height - 1);
+         gdk_draw_line (window, gc4,
+                        x + width - 1, y, x + width - 1, y + height - 1);
+         if (gap_x > 0)
+           {
+             gdk_draw_line (window, gc1,
+                            x, y, x, y + gap_x - 1);
+             gdk_draw_line (window, gc2,
+                            x + 1, y + 1, x + 1, y + gap_x - 1);
+             gdk_draw_line (window, gc2,
+                            x, y + gap_x, x, y + gap_x);
+           }
+         if ((width - (gap_x + gap_width)) > 0)
+           {
+             gdk_draw_line (window, gc1,
+                            x, y + gap_x + gap_width, x, y + height - 2);
+             gdk_draw_line (window, gc2,
+                            x + 1, y + gap_x + gap_width, x + 1, y + height - 2);
+             gdk_draw_line (window, gc2,
+                            x, y + gap_x + gap_width - 1, x, y + gap_x + gap_width - 1);
+           }
+       }
+      else if (gap_side == 3)
+       /* right */
+       {
          gdk_draw_line (window, gc1,
-                        x + 1, y + 1,
-                        x + 1, y + height - 1);
+                        x, y, x + width - 1, y);
          gdk_draw_line (window, gc1,
-                        x + 1, y + height - 1,
-                        x + width - 1, y + half_height + 1);
-         
-          points[0].x = x + width - 2;
-          points[0].y = y + half_height;
-          points[1].x = x;
-          points[1].y = y;
-          points[2].x = x;
-          points[2].y = y + height - 1;
-
-          gdk_draw_polygon (window, gc2, FALSE, points, 3);
-         break;
+                        x, y, x, y + height - 1);
+         gdk_draw_line (window, gc2,
+                        x + 1, y + 1, x + width - 1, y + 1);
+         gdk_draw_line (window, gc2,
+                        x + 1, y + 1, x + 1, y + height - 2);
 
-       default:
-         break;
+         gdk_draw_line (window, gc3,
+                        x + 1, y + height - 2, x + width - 1, y + height - 2);
+         gdk_draw_line (window, gc4,
+                        x, y + height - 1, x + width - 1, y + height - 1);
+         if (gap_x > 0)
+           {
+             gdk_draw_line (window, gc4,
+                            x + width - 1, y, x + width - 1, y + gap_x - 1);
+             gdk_draw_line (window, gc3,
+                            x + width - 2, y + 1, x + width - 2, y + gap_x - 1);
+             gdk_draw_line (window, gc3,
+                            x + width - 1, y + gap_x, x + width - 1, y + gap_x);
+           }
+         if ((width - (gap_x + gap_width)) > 0)
+           {
+             gdk_draw_line (window, gc4,
+                            x + width - 1, y + gap_x + gap_width, x + width - 1, y + height - 2);
+             gdk_draw_line (window, gc3,
+                            x + width - 2, y + gap_x + gap_width, x + width - 2, y + height - 2);
+             gdk_draw_line (window, gc3,
+                            x + width - 1, y + gap_x + gap_width - 1, x + width - 1, y + gap_x + gap_width - 1);
+           }
        }
-      break;
+    }
+  if (area)
+    {
+      gdk_gc_set_clip_rectangle (gc1, NULL);
+      gdk_gc_set_clip_rectangle (gc2, NULL);
+      gdk_gc_set_clip_rectangle (gc3, NULL);
+      gdk_gc_set_clip_rectangle (gc4, NULL);
     }
 }
 
-static void
-gtk_default_draw_diamond (GtkStyle      *style,
-                         GdkWindow     *window,
-                         GtkStateType   state_type,
-                         GtkShadowType  shadow_type,
-                         gint           x,
-                         gint           y,
-                         gint           width,
-                         gint           height)
+static void 
+gtk_default_draw_extension (GtkStyle       *style,
+                           GdkWindow      *window,
+                           GtkStateType    state_type,
+                           GtkShadowType   shadow_type,
+                           GdkRectangle   *area,
+                           GtkWidget      *widget,
+                           gchar          *detail,
+                           gint            x,
+                           gint            y,
+                           gint            width,
+                           gint            height,
+                           GtkPositionType gap_side)
 {
-  gint half_width;
-  gint half_height;
+  GdkGC *gc1 = NULL;
+  GdkGC *gc2 = NULL;
+  GdkGC *gc3 = NULL;
+  GdkGC *gc4 = NULL;
 
   g_return_if_fail (style != NULL);
   g_return_if_fail (window != NULL);
 
+  gtk_style_apply_default_pixmap(style, window, GTK_STATE_NORMAL, area,
+                                x, y, width, height);
+
   if ((width == -1) && (height == -1))
     gdk_window_get_size (window, &width, &height);
   else if (width == -1)
@@ -1625,125 +2795,293 @@ gtk_default_draw_diamond (GtkStyle      *style,
   else if (height == -1)
     gdk_window_get_size (window, NULL, &height);
 
-  half_width = width / 2;
-  half_height = height / 2;
-
   switch (shadow_type)
     {
-    case GTK_SHADOW_IN:
-      gdk_draw_line (window, style->bg_gc[state_type],
-                     x + 2, y + half_height,
-                     x + half_width, y + height - 2);
-      gdk_draw_line (window, style->bg_gc[state_type],
-                     x + half_width, y + height - 2,
-                     x + width - 2, y + half_height);
-      gdk_draw_line (window, style->light_gc[state_type],
-                     x + 1, y + half_height,
-                     x + half_width, y + height - 1);
-      gdk_draw_line (window, style->light_gc[state_type],
-                     x + half_width, y + height - 1,
-                     x + width - 1, y + half_height);
-      gdk_draw_line (window, style->light_gc[state_type],
-                     x, y + half_height,
-                     x + half_width, y + height);
-      gdk_draw_line (window, style->light_gc[state_type],
-                     x + half_width, y + height,
-                     x + width, y + half_height);
-
-      gdk_draw_line (window, style->black_gc,
-                     x + 2, y + half_height,
-                     x + half_width, y + 2);
-      gdk_draw_line (window, style->black_gc,
-                     x + half_width, y + 2,
-                     x + width - 2, y + half_height);
-      gdk_draw_line (window, style->dark_gc[state_type],
-                     x + 1, y + half_height,
-                     x + half_width, y + 1);
-      gdk_draw_line (window, style->dark_gc[state_type],
-                     x + half_width, y + 1,
-                     x + width - 1, y + half_height);
-      gdk_draw_line (window, style->dark_gc[state_type],
-                     x, y + half_height,
-                     x + half_width, y);
-      gdk_draw_line (window, style->dark_gc[state_type],
-                     x + half_width, y,
-                     x + width, y + half_height);
+     case GTK_SHADOW_NONE:
+      return;
+     case GTK_SHADOW_IN:
+      gc1 = style->dark_gc[state_type];
+      gc2 = style->black_gc;
+      gc3 = style->bg_gc[state_type];
+      gc4 = style->light_gc[state_type];
       break;
-    case GTK_SHADOW_OUT:
-      gdk_draw_line (window, style->dark_gc[state_type],
-                     x + 2, y + half_height,
-                     x + half_width, y + height - 2);
-      gdk_draw_line (window, style->dark_gc[state_type],
-                     x + half_width, y + height - 2,
-                     x + width - 2, y + half_height);
-      gdk_draw_line (window, style->dark_gc[state_type],
-                     x + 1, y + half_height,
-                     x + half_width, y + height - 1);
-      gdk_draw_line (window, style->dark_gc[state_type],
-                     x + half_width, y + height - 1,
-                     x + width - 1, y + half_height);
-      gdk_draw_line (window, style->black_gc,
-                     x, y + half_height,
-                     x + half_width, y + height);
-      gdk_draw_line (window, style->black_gc,
-                     x + half_width, y + height,
-                     x + width, y + half_height);
-
-      gdk_draw_line (window, style->bg_gc[state_type],
-                     x + 2, y + half_height,
-                     x + half_width, y + 2);
-      gdk_draw_line (window, style->bg_gc[state_type],
-                     x + half_width, y + 2,
-                     x + width - 2, y + half_height);
-      gdk_draw_line (window, style->light_gc[state_type],
-                     x + 1, y + half_height,
-                     x + half_width, y + 1);
-      gdk_draw_line (window, style->light_gc[state_type],
-                     x + half_width, y + 1,
-                     x + width - 1, y + half_height);
-      gdk_draw_line (window, style->light_gc[state_type],
-                     x, y + half_height,
-                     x + half_width, y);
-      gdk_draw_line (window, style->light_gc[state_type],
-                     x + half_width, y,
-                     x + width, y + half_height);
+     case GTK_SHADOW_ETCHED_IN:
+      gc1 = style->dark_gc[state_type];
+      gc2 = style->light_gc[state_type];
+      gc3 = style->dark_gc[state_type];
+      gc4 = style->light_gc[state_type];
       break;
-    default:
+     case GTK_SHADOW_OUT:
+      gc1 = style->light_gc[state_type];
+      gc2 = style->bg_gc[state_type];
+      gc3 = style->dark_gc[state_type];
+      gc4 = style->black_gc;
+      break;
+     case GTK_SHADOW_ETCHED_OUT:
+      gc1 = style->light_gc[state_type];
+      gc2 = style->dark_gc[state_type];
+      gc3 = style->light_gc[state_type];
+      gc4 = style->dark_gc[state_type];
       break;
     }
+  if (area)
+    {
+      gdk_gc_set_clip_rectangle (gc1, area);
+      gdk_gc_set_clip_rectangle (gc2, area);
+      gdk_gc_set_clip_rectangle (gc3, area);
+      gdk_gc_set_clip_rectangle (gc4, area);
+    }
+   switch (shadow_type)
+    {
+    case GTK_SHADOW_NONE:
+    case GTK_SHADOW_IN:
+    case GTK_SHADOW_OUT:
+    case GTK_SHADOW_ETCHED_IN:
+    case GTK_SHADOW_ETCHED_OUT:
+      switch (gap_side)
+       {
+       case GTK_POS_TOP:
+         gtk_style_apply_default_pixmap(style, window, state_type, area,
+                                        x + style->klass->xthickness, 
+                                        y, 
+                                        width - (2 * style->klass->xthickness), 
+                                        height - (style->klass->ythickness));
+         gdk_draw_line (window, gc1,
+                        x, y, x, y + height - 2);
+         gdk_draw_line (window, gc2,
+                        x + 1, y, x + 1, y + height - 2);
+
+         gdk_draw_line (window, gc3,
+                        x + 2, y + height - 2, x + width - 2, y + height - 2);
+         gdk_draw_line (window, gc3,
+                        x + width - 2, y, x + width - 2, y + height - 2);
+         gdk_draw_line (window, gc4,
+                        x + 1, y + height - 1, x + width - 2, y + height - 1);
+         gdk_draw_line (window, gc4,
+                        x + width - 1, y, x + width - 1, y + height - 2);
+         break;
+       case GTK_POS_BOTTOM:
+         gtk_style_apply_default_pixmap(style, window, state_type, area,
+                                        x + style->klass->xthickness, 
+                                        y + style->klass->ythickness, 
+                                        width - (2 * style->klass->xthickness), 
+                                        height - (style->klass->ythickness));
+         gdk_draw_line (window, gc1,
+                        x + 1, y, x + width - 2, y);
+         gdk_draw_line (window, gc1,
+                        x, y + 1, x, y + height - 1);
+         gdk_draw_line (window, gc2,
+                        x + 1, y + 1, x + width - 2, y + 1);
+         gdk_draw_line (window, gc2,
+                        x + 1, y + 1, x + 1, y + height - 1);
+
+         gdk_draw_line (window, gc3,
+                        x + width - 2, y + 2, x + width - 2, y + height - 1);
+         gdk_draw_line (window, gc4,
+                        x + width - 1, y + 1, x + width - 1, y + height - 1);
+         break;
+       case GTK_POS_LEFT:
+         gtk_style_apply_default_pixmap(style, window, state_type, area,
+                                        x, 
+                                        y + style->klass->ythickness, 
+                                        width - (style->klass->xthickness), 
+                                        height - (2 * style->klass->ythickness));
+         gdk_draw_line (window, gc1,
+                        x, y, x + width - 2, y);
+         gdk_draw_line (window, gc2,
+                        x + 1, y + 1, x + width - 2, y + 1);
+
+         gdk_draw_line (window, gc3,
+                        x, y + height - 2, x + width - 2, y + height - 2);
+         gdk_draw_line (window, gc3,
+                        x + width - 2, y + 2, x + width - 2, y + height - 2);
+         gdk_draw_line (window, gc4,
+                        x, y + height - 1, x + width - 2, y + height - 1);
+         gdk_draw_line (window, gc4,
+                        x + width - 1, y + 1, x + width - 1, y + height - 2);
+         break;
+       case GTK_POS_RIGHT:
+         gtk_style_apply_default_pixmap(style, window, state_type, area,
+                                        x + style->klass->xthickness, 
+                                        y + style->klass->ythickness, 
+                                        width - (style->klass->xthickness), 
+                                        height - (2 * style->klass->ythickness));
+         gdk_draw_line (window, gc1,
+                        x + 1, y, x + width - 1, y);
+         gdk_draw_line (window, gc1,
+                        x, y + 1, x, y + height - 2);
+         gdk_draw_line (window, gc2,
+                        x + 1, y + 1, x + width - 1, y + 1);
+         gdk_draw_line (window, gc2,
+                        x + 1, y + 1, x + 1, y + height - 2);
+
+         gdk_draw_line (window, gc3,
+                        x + 2, y + height - 2, x + width - 1, y + height - 2);
+         gdk_draw_line (window, gc4,
+                        x + 1, y + height - 1, x + width - 1, y + height - 1);
+         break;
+       }
+    }
+  if (area)
+    {
+      gdk_gc_set_clip_rectangle (gc1, NULL);
+      gdk_gc_set_clip_rectangle (gc2, NULL);
+      gdk_gc_set_clip_rectangle (gc3, NULL);
+      gdk_gc_set_clip_rectangle (gc4, NULL);
+    }
 }
 
-
-static void
-gtk_default_draw_oval (GtkStyle      *style,
-                      GdkWindow     *window,
-                      GtkStateType   state_type,
-                      GtkShadowType  shadow_type,
-                      gint           x,
-                      gint           y,
-                      gint           width,
-                      gint           height)
+static void 
+gtk_default_draw_focus (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       gint           x,
+                       gint           y,
+                       gint           width,
+                       gint           height)
 {
-  g_return_if_fail (style != NULL);
-  g_return_if_fail (window != NULL);
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (window != NULL);
+   
+   if ((width == -1) && (height == -1))
+     {
+       gdk_window_get_size (window, &width, &height);
+       width -= 1;
+       height -= 1;
+     }
+   else if (width == -1)
+     {
+       gdk_window_get_size (window, &width, NULL);
+       width -= 1;
+     }
+   else if (height == -1)
+     {
+       gdk_window_get_size (window, NULL, &height);
+       height -= 1;
+     }
+   if (area)
+     {
+       gdk_gc_set_clip_rectangle (style->black_gc, area);
+     }
+   if (detail && !strcmp (detail, "add-mode"))
+     {
+       gdk_gc_set_line_attributes (style->black_gc, 1, GDK_LINE_ON_OFF_DASH, 0, 0);
+       gdk_gc_set_dashes (style->black_gc, 0, "\4\4", 2);
+       
+       gdk_draw_rectangle (window,
+                          style->black_gc, FALSE,
+                          x, y, width, height);
+       
+       gdk_gc_set_line_attributes (style->black_gc, 1, GDK_LINE_SOLID, 0, 0);
+     }
+   else
+     {
+       gdk_draw_rectangle (window,
+                          style->black_gc, FALSE,
+                          x, y, width, height);
+     }
+   if (area)
+     {
+       gdk_gc_set_clip_rectangle (style->black_gc, NULL);
+     }
 }
 
-static void
-gtk_default_draw_string (GtkStyle      *style,
+static void 
+gtk_default_draw_slider (GtkStyle      *style,
                         GdkWindow     *window,
                         GtkStateType   state_type,
+                        GtkShadowType  shadow_type,
+                        GdkRectangle  *area,
+                        GtkWidget     *widget,
+                        gchar         *detail,
                         gint           x,
                         gint           y,
-                        const gchar   *string)
+                        gint           width,
+                        gint           height,
+                        GtkOrientation orientation)
 {
-  g_return_if_fail (style != NULL);
-  g_return_if_fail (window != NULL);
-
-  if (state_type == GTK_STATE_INSENSITIVE)
-    gdk_draw_string (window, style->font, style->white_gc, x + 1, y + 1, string);
-  gdk_draw_string (window, style->font, style->fg_gc[state_type], x, y, string);
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (window != NULL);
+   
+   if ((width == -1) && (height == -1))
+     gdk_window_get_size (window, &width, &height);
+   else if (width == -1)
+     gdk_window_get_size (window, &width, NULL);
+   else if (height == -1)
+     gdk_window_get_size (window, NULL, &height);
+   
+   gtk_paint_box (style, window, state_type, shadow_type,
+                 area, widget, detail, x, y, width, height);
+   if (orientation == GTK_ORIENTATION_HORIZONTAL)
+     gtk_paint_vline (style, window, state_type, area, widget, detail, 
+                    style->klass->ythickness, 
+                    height - style->klass->ythickness - 1, width / 2);
+   else
+     gtk_paint_hline (style, window, state_type, area, widget, detail, 
+                     style->klass->xthickness, 
+                     width - style->klass->xthickness - 1, height / 2);
 }
 
+static void 
+gtk_default_draw_handle  (GtkStyle      *style,
+                         GdkWindow     *window,
+                         GtkStateType   state_type,
+                         GtkShadowType  shadow_type,
+                         GdkRectangle  *area,
+                         GtkWidget     *widget,
+                         gchar         *detail,
+                         gint           x,
+                         gint           y,
+                         gint           width,
+                         gint           height,
+                         GtkOrientation orientation)
+{
+   gint xx, yy;
+   gint xthick, ythick;
+   GdkGC *light_gc, *dark_gc;
+   GdkRectangle dest;
+   
+   g_return_if_fail (style != NULL);
+   g_return_if_fail (window != NULL);
+   
+   if ((width == -1) && (height == -1))
+     gdk_window_get_size (window, &width, &height);
+   else if (width == -1)
+     gdk_window_get_size (window, &width, NULL);
+   else if (height == -1)
+     gdk_window_get_size (window, NULL, &height);
+   
+   gtk_paint_box (style, window, state_type, shadow_type, area, widget, 
+                 detail, x, y, width, height);
+
+   light_gc = style->light_gc[state_type];
+   dark_gc = style->dark_gc[state_type];
+   
+   xthick = style->klass->xthickness;
+   ythick = style->klass->ythickness;
+
+   dest.x = x + xthick;
+   dest.y = y + ythick;
+   dest.width = width - (xthick * 2);
+   dest.height = height - (ythick * 2);
+
+   gdk_gc_set_clip_rectangle (light_gc, &dest);
+   gdk_gc_set_clip_rectangle (dark_gc, &dest);
+   
+   for (yy = y + ythick; yy < (y + height - ythick); yy += 3)
+     for (xx = x + xthick; xx < (x + width - xthick); xx += 6)
+     {
+       gdk_draw_point (window, light_gc, xx, yy);
+       gdk_draw_point (window, dark_gc, xx + 1, yy + 1);
+
+       gdk_draw_point (window, light_gc, xx + 3, yy + 1);
+       gdk_draw_point (window, dark_gc, xx + 4, yy + 2);
+     }
+   gdk_gc_set_clip_rectangle (light_gc, NULL);
+   gdk_gc_set_clip_rectangle (dark_gc, NULL);
+}
 
 static void
 gtk_style_shade (GdkColor *a,
@@ -1928,3 +3266,427 @@ hls_to_rgb (gdouble *h,
       *s = b;
     }
 }
+void 
+gtk_paint_hline (GtkStyle      *style,
+                GdkWindow     *window,
+                GtkStateType   state_type,
+                GdkRectangle  *area,
+                GtkWidget     *widget,
+                gchar         *detail,
+                gint          x1,
+                gint          x2,
+                gint          y)
+{
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (style->klass != NULL);
+  g_return_if_fail (style->klass->draw_hline != NULL);
+
+  (*style->klass->draw_hline) (style, window, state_type, area, widget, detail, x1, x2, y);
+}
+
+void
+gtk_paint_vline (GtkStyle      *style,
+                GdkWindow     *window,
+                GtkStateType   state_type,
+                GdkRectangle  *area,
+                GtkWidget     *widget,
+                gchar         *detail,
+                gint          y1,
+                gint          y2,
+                gint          x)
+{
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (style->klass != NULL);
+  g_return_if_fail (style->klass->draw_vline != NULL);
+   
+  (*style->klass->draw_vline) (style, window, state_type, area, widget, detail, y1, y2, x);
+}
+
+void
+gtk_paint_shadow (GtkStyle     *style,
+                 GdkWindow    *window,
+                 GtkStateType  state_type,
+                 GtkShadowType shadow_type,
+                 GdkRectangle  *area,
+                 GtkWidget     *widget,
+                 gchar         *detail,
+                 gint         x,
+                 gint         y,
+                 gint         width,
+                 gint         height)
+{
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (style->klass != NULL);
+  g_return_if_fail (style->klass->draw_shadow != NULL);
+   
+  (*style->klass->draw_shadow) (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
+}
+
+void
+gtk_paint_polygon (GtkStyle      *style,
+                  GdkWindow     *window,
+                  GtkStateType   state_type,
+                  GtkShadowType  shadow_type,
+                  GdkRectangle  *area,
+                  GtkWidget     *widget,
+                  gchar         *detail,
+                  GdkPoint      *points,
+                  gint           npoints,
+                  gboolean       fill)
+{
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (style->klass != NULL);
+  g_return_if_fail (style->klass->draw_shadow != NULL);
+
+  (*style->klass->draw_polygon) (style, window, state_type, shadow_type, area, widget, detail, points, npoints, fill);
+}
+
+void
+gtk_paint_arrow (GtkStyle      *style,
+                GdkWindow     *window,
+                GtkStateType   state_type,
+                GtkShadowType  shadow_type,
+                GdkRectangle  *area,
+                GtkWidget     *widget,
+                gchar         *detail,
+                GtkArrowType   arrow_type,
+                gboolean       fill,
+                gint           x,
+                gint           y,
+                gint           width,
+                gint           height)
+{
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (style->klass != NULL);
+  g_return_if_fail (style->klass->draw_arrow != NULL);
+
+  (*style->klass->draw_arrow) (style, window, state_type, shadow_type, area, widget, detail, arrow_type, fill, x, y, width, height);
+}
+
+void
+gtk_paint_diamond (GtkStyle      *style,
+                  GdkWindow     *window,
+                  GtkStateType   state_type,
+                  GtkShadowType  shadow_type,
+                  GdkRectangle  *area,
+                  GtkWidget     *widget,
+                  gchar         *detail,
+                  gint        x,
+                  gint        y,
+                  gint        width,
+                  gint        height)
+{
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (style->klass != NULL);
+  g_return_if_fail (style->klass->draw_diamond != NULL);
+
+  (*style->klass->draw_diamond) (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
+}
+
+void
+gtk_paint_oval (GtkStyle      *style,
+               GdkWindow     *window,
+               GtkStateType   state_type,
+               GtkShadowType  shadow_type,
+               GdkRectangle  *area,
+               GtkWidget     *widget,
+               gchar         *detail,
+               gint           x,
+               gint           y,
+               gint           width,
+               gint           height)
+{
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (style->klass != NULL);
+  g_return_if_fail (style->klass->draw_oval != NULL);
+
+  (*style->klass->draw_oval) (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
+}
+
+void
+gtk_paint_string (GtkStyle      *style,
+                 GdkWindow     *window,
+                 GtkStateType   state_type,
+                 GdkRectangle  *area,
+                 GtkWidget     *widget,
+                 gchar         *detail,
+                 gint         x,
+                 gint         y,
+                 const gchar   *string)
+{
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (style->klass != NULL);
+  g_return_if_fail (style->klass->draw_oval != NULL);
+
+  (*style->klass->draw_string) (style, window, state_type, area, widget, detail, x, y, string);
+}
+
+void
+gtk_paint_box (GtkStyle      *style,
+              GdkWindow     *window,
+              GtkStateType   state_type,
+              GtkShadowType  shadow_type,
+              GdkRectangle  *area,
+              GtkWidget     *widget,
+              gchar         *detail,
+              gint            x,
+              gint            y,
+              gint            width,
+              gint            height)
+{
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (style->klass != NULL);
+  g_return_if_fail (style->klass->draw_box != NULL);
+
+  (*style->klass->draw_box) (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
+}
+
+void
+gtk_paint_flat_box (GtkStyle      *style,
+                   GdkWindow     *window,
+                   GtkStateType   state_type,
+                   GtkShadowType  shadow_type,
+                   GdkRectangle  *area,
+                   GtkWidget     *widget,
+                   gchar         *detail,
+                   gint           x,
+                   gint           y,
+                   gint           width,
+                   gint           height)
+{
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (style->klass != NULL);
+  g_return_if_fail (style->klass->draw_flat_box != NULL);
+
+  (*style->klass->draw_flat_box) (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
+}
+
+void
+gtk_paint_check (GtkStyle      *style,
+                GdkWindow     *window,
+                GtkStateType   state_type,
+                GtkShadowType  shadow_type,
+                GdkRectangle  *area,
+                GtkWidget     *widget,
+                gchar         *detail,
+                gint           x,
+                gint           y,
+                gint           width,
+                gint           height)
+{
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (style->klass != NULL);
+  g_return_if_fail (style->klass->draw_check != NULL);
+
+  (*style->klass->draw_check) (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
+}
+
+void
+gtk_paint_option (GtkStyle      *style,
+                 GdkWindow     *window,
+                 GtkStateType   state_type,
+                 GtkShadowType  shadow_type,
+                 GdkRectangle  *area,
+                 GtkWidget     *widget,
+                 gchar         *detail,
+                 gint           x,
+                 gint           y,
+                 gint           width,
+                 gint           height)
+{
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (style->klass != NULL);
+  g_return_if_fail (style->klass->draw_option != NULL);
+
+  (*style->klass->draw_option) (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
+}
+
+void
+gtk_paint_cross (GtkStyle      *style,
+                GdkWindow     *window,
+                GtkStateType   state_type,
+                GtkShadowType  shadow_type,
+                GdkRectangle  *area,
+                GtkWidget     *widget,
+                gchar         *detail,
+                gint           x,
+                gint           y,
+                gint           width,
+                gint           height)
+{
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (style->klass != NULL);
+  g_return_if_fail (style->klass->draw_cross != NULL);
+
+  (*style->klass->draw_cross) (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
+}
+
+void
+gtk_paint_ramp (GtkStyle      *style,
+               GdkWindow     *window,
+               GtkStateType   state_type,
+               GtkShadowType  shadow_type,
+               GdkRectangle  *area,
+               GtkWidget     *widget,
+               gchar         *detail,
+               GtkArrowType   arrow_type,
+               gint           x,
+               gint           y,
+               gint           width,
+               gint           height)
+{
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (style->klass != NULL);
+  g_return_if_fail (style->klass->draw_ramp != NULL);
+
+  (*style->klass->draw_ramp) (style, window, state_type, shadow_type, area, widget, detail, arrow_type, x, y, width, height);
+}
+
+void
+gtk_paint_tab (GtkStyle      *style,
+              GdkWindow     *window,
+              GtkStateType   state_type,
+              GtkShadowType  shadow_type,
+              GdkRectangle  *area,
+              GtkWidget     *widget,
+              gchar         *detail,
+              gint           x,
+              gint           y,
+              gint           width,
+              gint           height)
+{
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (style->klass != NULL);
+  g_return_if_fail (style->klass->draw_tab != NULL);
+
+  (*style->klass->draw_tab) (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
+}
+
+void
+gtk_paint_shadow_gap (GtkStyle       *style,
+                     GdkWindow      *window,
+                     GtkStateType    state_type,
+                     GtkShadowType   shadow_type,
+                     GdkRectangle   *area,
+                     GtkWidget      *widget,
+                     gchar          *detail,
+                     gint            x,
+                     gint            y,
+                     gint            width,
+                     gint            height,
+                     GtkPositionType gap_side,
+                     gint            gap_x,
+                     gint            gap_width)
+{
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (style->klass != NULL);
+  g_return_if_fail (style->klass->draw_shadow_gap != NULL);
+
+  (*style->klass->draw_shadow_gap) (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, gap_side, gap_x, gap_width);
+}
+
+
+void
+gtk_paint_box_gap (GtkStyle       *style,
+                  GdkWindow      *window,
+                  GtkStateType    state_type,
+                  GtkShadowType   shadow_type,
+                  GdkRectangle   *area,
+                  GtkWidget      *widget,
+                  gchar          *detail,
+                  gint            x,
+                  gint            y,
+                  gint            width,
+                  gint            height,
+                  GtkPositionType gap_side,
+                  gint            gap_x,
+                  gint            gap_width)
+{
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (style->klass != NULL);
+  g_return_if_fail (style->klass->draw_box_gap != NULL);
+
+  (*style->klass->draw_box_gap) (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, gap_side, gap_x, gap_width);
+}
+
+void
+gtk_paint_extension (GtkStyle       *style,
+                    GdkWindow      *window,
+                    GtkStateType    state_type,
+                    GtkShadowType   shadow_type,
+                    GdkRectangle   *area,
+                    GtkWidget      *widget,
+                    gchar          *detail,
+                    gint            x,
+                    gint            y,
+                    gint            width,
+                    gint            height,
+                    GtkPositionType gap_side)
+{
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (style->klass != NULL);
+  g_return_if_fail (style->klass->draw_extension != NULL);
+
+  (*style->klass->draw_extension) (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, gap_side);
+}
+
+void
+gtk_paint_focus (GtkStyle      *style,
+                GdkWindow     *window,
+                GdkRectangle  *area,
+                GtkWidget     *widget,
+                gchar         *detail,
+                gint           x,
+                gint           y,
+                gint           width,
+                gint           height)
+{
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (style->klass != NULL);
+  g_return_if_fail (style->klass->draw_focus != NULL);
+
+  (*style->klass->draw_focus) (style, window, area, widget, detail, x, y, width, height);
+}
+
+void
+gtk_paint_slider (GtkStyle      *style,
+                 GdkWindow     *window,
+                 GtkStateType   state_type,
+                 GtkShadowType  shadow_type,
+                 GdkRectangle  *area,
+                 GtkWidget     *widget,
+                 gchar         *detail,
+                 gint           x,
+                 gint           y,
+                 gint           width,
+                 gint           height,
+                 GtkOrientation orientation)
+{
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (style->klass != NULL);
+  g_return_if_fail (style->klass->draw_slider != NULL);
+
+  (*style->klass->draw_slider) (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, orientation);
+}
+
+void
+gtk_paint_handle (GtkStyle      *style,
+                 GdkWindow     *window,
+                 GtkStateType   state_type,
+                 GtkShadowType  shadow_type,
+                 GdkRectangle  *area,
+                 GtkWidget     *widget,
+                 gchar         *detail,
+                 gint           x,
+                 gint           y,
+                 gint           width,
+                 gint           height,
+                 GtkOrientation orientation)
+{
+  g_return_if_fail (style != NULL);
+  g_return_if_fail (style->klass != NULL);
+  g_return_if_fail (style->klass->draw_handle != NULL);
+
+  (*style->klass->draw_handle) (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, orientation);
+}
index 0def4b5c529c32227bc4375ff257773fc8367065..556722475c8dad00c6222f0ba7642036c24d563b 100644 (file)
@@ -23,7 +23,6 @@
 #include <gdk/gdk.h>
 #include <gtk/gtkenums.h>
 
-
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
@@ -31,6 +30,18 @@ extern "C" {
 typedef struct _GtkStyle       GtkStyle;
 typedef struct _GtkStyleClass  GtkStyleClass;
 
+/* Some forward declarations needed to rationalize the header
+ * files.
+ */
+
+typedef struct _GtkThemeEngine GtkThemeEngine;
+typedef struct _GtkRcStyle     GtkRcStyle;
+
+/* We make this forward declaration here, since we pass
+ * GtkWidgt's to the draw functions.
+ */
+typedef struct _GtkWidget      GtkWidget;
+
 /* This is used for having dynamic style changing stuff */
 /* fg, bg, light, dark, mid, text, base */
 #define GTK_STYLE_NUM_STYLECOLORS() 7*5
@@ -63,13 +74,21 @@ struct _GtkStyle
 
   GdkPixmap *bg_pixmap[5];
 
+  /* Private */
   gint ref_count;
   gint attach_count;
 
   gint depth;
   GdkColormap *colormap;
 
-  GtkStyleClass *klass;
+  GtkStyleClass  *klass;        /* Not private - reorder me */
+  GtkThemeEngine *engine;
+
+  gpointer        engine_data;
+
+  GtkRcStyle     *rc_style;    /* the Rc style from which this style
+                                * was created */
+  GSList         *styles;
 };
 
 struct _GtkStyleClass
@@ -80,12 +99,18 @@ struct _GtkStyleClass
   void (*draw_hline)   (GtkStyle      *style,
                        GdkWindow     *window,
                        GtkStateType   state_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
                        gint           x1,
                        gint           x2,
                        gint           y);
   void (*draw_vline)   (GtkStyle      *style,
                        GdkWindow     *window,
                        GtkStateType   state_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
                        gint           y1,
                        gint           y2,
                        gint           x);
@@ -93,6 +118,9 @@ struct _GtkStyleClass
                        GdkWindow     *window,
                        GtkStateType   state_type,
                        GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
                        gint           x,
                        gint           y,
                        gint           width,
@@ -101,15 +129,21 @@ struct _GtkStyleClass
                        GdkWindow     *window,
                        GtkStateType   state_type,
                        GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
                        GdkPoint      *point,
                        gint           npoints,
-                       gint           fill);
+                       gboolean       fill);
   void (*draw_arrow)   (GtkStyle      *style,
                        GdkWindow     *window,
                        GtkStateType   state_type,
                        GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
                        GtkArrowType   arrow_type,
-                       gint           fill,
+                       gboolean       fill,
                        gint           x,
                        gint           y,
                        gint           width,
@@ -118,6 +152,9 @@ struct _GtkStyleClass
                        GdkWindow     *window,
                        GtkStateType   state_type,
                        GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
                        gint           x,
                        gint           y,
                        gint           width,
@@ -126,6 +163,9 @@ struct _GtkStyleClass
                        GdkWindow     *window,
                        GtkStateType   state_type,
                        GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
                        gint           x,
                        gint           y,
                        gint           width,
@@ -133,12 +173,165 @@ struct _GtkStyleClass
   void (*draw_string)  (GtkStyle      *style,
                        GdkWindow     *window,
                        GtkStateType   state_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
                        gint           x,
                        gint           y,
                        const gchar   *string);
+  void (*draw_box)     (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       gint           x,
+                       gint           y,
+                       gint           width,
+                       gint           height);
+  void (*draw_flat_box) (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       gint           x,
+                       gint           y,
+                       gint           width,
+                       gint           height);
+  void (*draw_check)   (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       gint           x,
+                       gint           y,
+                       gint           width,
+                       gint           height);
+  void (*draw_option)  (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       gint           x,
+                       gint           y,
+                       gint           width,
+                       gint           height);
+  void (*draw_cross)   (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       gint           x,
+                       gint           y,
+                       gint           width,
+                       gint           height);
+  void (*draw_ramp)    (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       GtkArrowType   arrow_type,
+                       gint           x,
+                       gint           y,
+                       gint           width,
+                       gint           height);
+  void (*draw_tab)     (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       gint           x,
+                       gint           y,
+                       gint           width,
+                       gint           height); 
+  void (*draw_shadow_gap) (GtkStyle       *style,
+                          GdkWindow      *window,
+                          GtkStateType    state_type,
+                          GtkShadowType   shadow_type,
+                          GdkRectangle   *area,
+                          GtkWidget      *widget,
+                          gchar          *detail,
+                          gint            x,
+                          gint            y,
+                          gint            width,
+                          gint            height,
+                          GtkPositionType gap_side,
+                          gint            gap_x,
+                          gint            gap_width);
+  void (*draw_box_gap) (GtkStyle       *style,
+                       GdkWindow      *window,
+                       GtkStateType    state_type,
+                       GtkShadowType   shadow_type,
+                       GdkRectangle   *area,
+                       GtkWidget      *widget,
+                       gchar          *detail,
+                       gint            x,
+                       gint            y,
+                       gint            width,
+                       gint            height,
+                       GtkPositionType gap_side,
+                       gint            gap_x,
+                       gint            gap_width);
+ void (*draw_extension) (GtkStyle       *style,
+                        GdkWindow      *window,
+                        GtkStateType    state_type,
+                        GtkShadowType   shadow_type,
+                        GdkRectangle   *area,
+                        GtkWidget      *widget,
+                        gchar          *detail,
+                        gint            x,
+                        gint            y,
+                        gint            width,
+                        gint            height,
+                        GtkPositionType gap_side);
+   void (*draw_focus) (GtkStyle      *style,
+                      GdkWindow     *window,
+                      GdkRectangle  *area,
+                      GtkWidget     *widget,
+                      gchar         *detail,
+                      gint           x,
+                      gint           y,
+                      gint           width,
+                      gint           height);
+   void (*draw_slider)  (GtkStyle      *style,
+                        GdkWindow     *window,
+                        GtkStateType   state_type,
+                        GtkShadowType  shadow_type,
+                        GdkRectangle  *area,
+                        GtkWidget     *widget,
+                        gchar         *detail,
+                        gint           x,
+                        gint           y,
+                        gint           width,
+                        gint           height,
+                        GtkOrientation orientation);
+   void (*draw_handle)  (GtkStyle      *style,
+                        GdkWindow     *window,
+                        GtkStateType   state_type,
+                        GtkShadowType  shadow_type,
+                        GdkRectangle  *area,
+                        GtkWidget     *widget,
+                        gchar         *detail,
+                        gint           x,
+                        gint           y,
+                        gint           width,
+                        gint           height,
+                        GtkOrientation orientation);
 };
 
-
 GtkStyle* gtk_style_new                   (void);
 GtkStyle* gtk_style_copy          (GtkStyle     *style);
 GtkStyle* gtk_style_attach        (GtkStyle     *style,
@@ -149,8 +342,15 @@ void         gtk_style_unref          (GtkStyle     *style);
 void     gtk_style_set_background (GtkStyle     *style,
                                    GdkWindow    *window,
                                    GtkStateType  state_type);
-
-
+void      gtk_style_apply_default_pixmap(GtkStyle     *style,
+                                        GdkWindow    *window, 
+                                        GtkStateType  state_type, 
+                                        GdkRectangle *area, 
+                                        gint x, 
+                                        gint y, 
+                                        gint width, 
+                                        gint height);
+      
 void gtk_draw_hline   (GtkStyle             *style,
                       GdkWindow     *window,
                       GtkStateType   state_type,
@@ -177,13 +377,13 @@ void gtk_draw_polygon (GtkStyle        *style,
                       GtkShadowType  shadow_type,
                       GdkPoint      *points,
                       gint           npoints,
-                      gint           fill);
+                      gboolean       fill);
 void gtk_draw_arrow   (GtkStyle             *style,
                       GdkWindow     *window,
                       GtkStateType   state_type,
                       GtkShadowType  shadow_type,
                       GtkArrowType   arrow_type,
-                      gint           fill,
+                      gboolean       fill,
                       gint           x,
                       gint           y,
                       gint           width,
@@ -210,8 +410,376 @@ void gtk_draw_string  (GtkStyle        *style,
                       gint           x,
                       gint           y,
                       const gchar   *string);
+void gtk_draw_box     (GtkStyle             *style,
+                      GdkWindow     *window,
+                      GtkStateType   state_type,
+                      GtkShadowType  shadow_type,
+                      gint           x,
+                      gint           y,
+                      gint           width,
+                      gint           height);
+void gtk_draw_flat_box (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GtkShadowType  shadow_type,
+                       gint           x,
+                       gint           y,
+                       gint           width,
+                       gint           height);
+void gtk_draw_check   (GtkStyle      *style,
+                      GdkWindow     *window,
+                      GtkStateType   state_type,
+                      GtkShadowType  shadow_type,
+                      gint           x,
+                      gint           y,
+                      gint           width,
+                      gint           height);
+void gtk_draw_option  (GtkStyle      *style,
+                      GdkWindow     *window,
+                      GtkStateType   state_type,
+                      GtkShadowType  shadow_type,
+                      gint           x,
+                      gint           y,
+                      gint           width,
+                      gint           height);
+void gtk_draw_cross   (GtkStyle      *style,
+                      GdkWindow     *window,
+                      GtkStateType   state_type,
+                      GtkShadowType  shadow_type,
+                      gint           x,
+                      gint           y,
+                      gint           width,
+                      gint           height);
+void gtk_draw_ramp    (GtkStyle      *style,
+                      GdkWindow     *window,
+                      GtkStateType   state_type,
+                      GtkShadowType  shadow_type,
+                      GtkArrowType   arrow_type,
+                      gint           x,
+                      gint           y,
+                      gint           width,
+                      gint           height);
+void gtk_draw_tab     (GtkStyle      *style,
+                      GdkWindow     *window,
+                      GtkStateType   state_type,
+                      GtkShadowType  shadow_type,
+                      gint           x,
+                      gint           y,
+                      gint           width,
+                      gint           height);
+void gtk_draw_shadow_gap (GtkStyle       *style,
+                         GdkWindow      *window,
+                         GtkStateType    state_type,
+                         GtkShadowType   shadow_type,
+                         gint            x,
+                         gint            y,
+                         gint            width,
+                         gint            height,
+                         GtkPositionType gap_side,
+                         gint            gap_x,
+                         gint            gap_width);
+void gtk_draw_box_gap (GtkStyle       *style,
+                      GdkWindow      *window,
+                      GtkStateType    state_type,
+                      GtkShadowType   shadow_type,
+                      gint            x,
+                      gint            y,
+                      gint            width,
+                      gint            height,
+                      GtkPositionType gap_side,
+                      gint            gap_x,
+                      gint            gap_width);
+void gtk_draw_extension (GtkStyle       *style,
+                        GdkWindow      *window,
+                        GtkStateType    state_type,
+                        GtkShadowType   shadow_type,
+                        gint            x,
+                        gint            y,
+                        gint            width,
+                        gint            height,
+                        GtkPositionType gap_side);
+void gtk_draw_focus   (GtkStyle      *style,
+                      GdkWindow     *window,
+                      gint           x,
+                      gint           y,
+                      gint           width,
+                      gint           height);
+void gtk_draw_slider  (GtkStyle      *style,
+                      GdkWindow     *window,
+                      GtkStateType   state_type,
+                      GtkShadowType  shadow_type,
+                      gint           x,
+                      gint           y,
+                      gint           width,
+                      gint           height,
+                      GtkOrientation orientation);
+void gtk_draw_handle  (GtkStyle      *style,
+                      GdkWindow     *window,
+                      GtkStateType   state_type,
+                      GtkShadowType  shadow_type,
+                      gint           x,
+                      gint           y,
+                      gint           width,
+                      gint           height,
+                      GtkOrientation orientation);
 
+/*
+ * NEW API CALLS
+ * 
+ * NEW API CALLS
+ * 
+ * NEW API CALLS
+ * 
+ * NEW API CALLS
+ * 
+ * NEW API CALLS
+ * 
+ * NEW API CALLS
+ * 
+ * NEW API CALLS
+ * 
+ * NEW API CALLS
+ * 
+ */
+   
+   
+void gtk_paint_hline   (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       gint           x1,
+                       gint           x2,
+                       gint           y);
+void gtk_paint_vline   (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       gint           y1,
+                       gint           y2,
+                       gint           x);
+void gtk_paint_shadow  (GtkStyle     *style,
+                       GdkWindow    *window,
+                       GtkStateType  state_type,
+                       GtkShadowType shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       gint           x,
+                       gint           y,
+                       gint           width,
+                       gint           height);
+void gtk_paint_polygon (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       GdkPoint      *points,
+                       gint           npoints,
+                       gboolean       fill);
+void gtk_paint_arrow   (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       GtkArrowType   arrow_type,
+                       gboolean       fill,
+                       gint           x,
+                       gint           y,
+                       gint           width,
+                       gint           height);
+void gtk_paint_diamond (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       gint           x,
+                       gint           y,
+                       gint           width,
+                       gint           height);
+void gtk_paint_oval    (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       gint           x,
+                       gint           y,
+                       gint           width,
+                       gint           height);
+void gtk_paint_string  (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       gint           x,
+                       gint           y,
+                       const gchar   *string);
+void gtk_paint_box     (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       gint           x,
+                       gint           y,
+                       gint           width,
+                       gint           height);
+void gtk_paint_flat_box (GtkStyle      *style,
+                        GdkWindow     *window,
+                        GtkStateType   state_type,
+                        GtkShadowType  shadow_type,
+                        GdkRectangle  *area,
+                        GtkWidget     *widget,
+                        gchar         *detail,
+                        gint           x,
+                        gint           y,
+                        gint           width,
+                        gint           height);
+void gtk_paint_check   (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       gint           x,
+                       gint           y,
+                       gint           width,
+                       gint           height);
+void gtk_paint_option  (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       gint           x,
+                       gint           y,
+                       gint           width,
+                       gint           height);
+void gtk_paint_cross   (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       gint           x,
+                       gint           y,
+                       gint           width,
+                       gint           height);
+void gtk_paint_ramp    (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       GtkArrowType   arrow_type,
+                       gint           x,
+                       gint           y,
+                       gint           width,
+                       gint           height);
+void gtk_paint_tab     (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       gint           x,
+                       gint           y,
+                       gint           width,
+                       gint           height);
+void gtk_paint_shadow_gap (GtkStyle       *style,
+                          GdkWindow      *window,
+                          GtkStateType    state_type,
+                          GtkShadowType   shadow_type,
+                          GdkRectangle   *area,
+                          GtkWidget      *widget,
+                          gchar          *detail,
+                          gint            x,
+                          gint            y,
+                          gint            width,
+                          gint            height,
+                          GtkPositionType gap_side,
+                          gint            gap_x,
+                          gint            gap_width);
+void gtk_paint_box_gap (GtkStyle       *style,
+                       GdkWindow      *window,
+                       GtkStateType    state_type,
+                       GtkShadowType   shadow_type,
+                       GdkRectangle   *area,
+                       GtkWidget      *widget,
+                       gchar          *detail,
+                       gint            x,
+                       gint            y,
+                       gint            width,
+                       gint            height,
+                       GtkPositionType gap_side,
+                       gint            gap_x,
+                       gint            gap_width);
+void gtk_paint_extension (GtkStyle       *style,
+                         GdkWindow      *window,
+                         GtkStateType    state_type,
+                         GtkShadowType   shadow_type,
+                         GdkRectangle   *area,
+                         GtkWidget      *widget,
+                         gchar          *detail,
+                         gint            x,
+                         gint            y,
+                         gint            width,
+                         gint            height,
+                         GtkPositionType gap_side);
+void gtk_paint_focus   (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       gint           x,
+                       gint           y,
+                       gint           width,
+                       gint           height);
+void gtk_paint_slider  (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       gint           x,
+                       gint           y,
+                       gint           width,
+                       gint           height,
+                       GtkOrientation orientation);
+void gtk_paint_handle  (GtkStyle      *style,
+                       GdkWindow     *window,
+                       GtkStateType   state_type,
+                       GtkShadowType  shadow_type,
+                       GdkRectangle  *area,
+                       GtkWidget     *widget,
+                       gchar         *detail,
+                       gint           x,
+                       gint           y,
+                       gint           width,
+                       gint           height,
+                       GtkOrientation orientation);
 
+void gtk_reset_widget_shapes(GtkWidget *widget);
+      
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 432754d5beb0047e3139d6a5f093f6c10cbdb8b1..fb76f1010b1a4d7997dea7eeea2dedc6973bef8a 100644 (file)
@@ -134,9 +134,6 @@ gtk_tearoff_menu_item_paint (GtkWidget   *widget,
       menu_item = GTK_MENU_ITEM (widget);
       tearoff_item = GTK_TEAROFF_MENU_ITEM (widget);
 
-      gtk_style_set_background (widget->style, widget->window, widget->state);
-      gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height);
-
       x = GTK_CONTAINER (menu_item)->border_width;
       y = GTK_CONTAINER (menu_item)->border_width;
       width = widget->allocation.width - x * 2;
@@ -144,11 +141,14 @@ gtk_tearoff_menu_item_paint (GtkWidget   *widget,
       right_max = x + width;
 
       if (widget->state == GTK_STATE_PRELIGHT)
-       gtk_draw_shadow (widget->style,
-                        widget->window,
-                        GTK_STATE_PRELIGHT,
-                        GTK_SHADOW_OUT,
-                        x, y, width, height);
+       gtk_paint_box (widget->style,
+                      widget->window,
+                      GTK_STATE_PRELIGHT,
+                      GTK_SHADOW_OUT,
+                      area, widget, "menuitem",
+                      x, y, width, height);
+       else
+        gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height);
 
       if (tearoff_item->torn_off)
        {
index b07e3b98afaa097b0ee773d5ba52ec6789d14e72..4ab73c7b94ecfa81a18b7eb7caf6de3511ca930c 100644 (file)
@@ -1350,18 +1350,19 @@ gtk_text_draw_focus (GtkWidget *widget)
          height -= 2;
          xextra -= 1;
          yextra -= 1;
-         
-         gdk_draw_rectangle (widget->window,
-                             widget->style->fg_gc[GTK_STATE_NORMAL],
-                             FALSE, 0, 0,
-                             widget->allocation.width - 1,
-                             widget->allocation.height - 1);
+
+         gtk_paint_focus (widget->style, widget->window,
+                          NULL, widget, "text",
+                          0, 0,
+                          widget->allocation.width - 1,
+                          widget->allocation.height - 1);
        }
-      
-      gtk_draw_shadow (widget->style, widget->window,
-                      GTK_STATE_NORMAL, GTK_SHADOW_IN,
-                      x, y, width, height);
-      
+
+      gtk_paint_shadow (widget->style, widget->window,
+                       GTK_STATE_NORMAL, GTK_SHADOW_IN,
+                       NULL, widget, "text",
+                       x, y, width, height);
+
       x += xthick; 
       y += ythick;
       width -= 2 * xthick;
@@ -1380,14 +1381,6 @@ gtk_text_draw_focus (GtkWidget *widget)
          /* bottom rect */
          clear_focus_area (text, x, x + height - yextra, width, yextra);
        }
-      else if (!GTK_WIDGET_HAS_FOCUS (widget))
-       {
-         gdk_draw_rectangle (widget->window,
-                             widget->style->base_gc[GTK_STATE_NORMAL], FALSE,
-                             x, y,
-                             width - 1,
-                             height - 1);
-       }
     }
   else
     {
@@ -4571,32 +4564,48 @@ expand_scratch_buffer (GtkText* text, guint len)
     }
 }
 
-/* Returns a GC to draw a background for the text at a mark,
- * or NULL, if the mark's background is NULL
- *
- * Side effect: modifies text->gc
+/* Side effect: modifies text->gc
  */
-static GdkGC *
-mark_bg_gc (GtkText* text, const GtkPropertyMark *mark)
+
+static void
+draw_bg_rect (GtkText* text, GtkPropertyMark *mark,
+             gint x, gint y, gint width, gint height,
+             gboolean already_cleared)
 {
   GtkEditable *editable = GTK_EDITABLE(text);
-  
+
   if ((mark->index >= MIN(editable->selection_start_pos, editable->selection_end_pos) &&
        mark->index < MAX(editable->selection_start_pos, editable->selection_end_pos)))
     {
-      if (editable->has_selection)
-       return GTK_WIDGET(text)->style->bg_gc[GTK_STATE_SELECTED];
-      else
-       return GTK_WIDGET(text)->style->bg_gc[GTK_STATE_ACTIVE];
+      gtk_paint_flat_box(GTK_WIDGET(text)->style, text->text_area,
+                        editable->has_selection ?
+                           GTK_STATE_SELECTED : GTK_STATE_ACTIVE, 
+                        GTK_SHADOW_NONE,
+                        NULL, GTK_WIDGET(text), "text",
+                        x, y, width, height);
     }
   else if (!gdk_color_equal(MARK_CURRENT_BACK (text, mark),
                            &GTK_WIDGET(text)->style->base[GTK_STATE_NORMAL]))
-    
     {
       gdk_gc_set_foreground (text->gc, MARK_CURRENT_BACK (text, mark));
-      return text->gc;
+
+      gdk_draw_rectangle (text->text_area,
+                         text->gc,
+                         TRUE, x, y, width, height);
+    }
+  else if (GTK_WIDGET (text)->style->bg_pixmap[GTK_STATE_NORMAL])
+    {
+      GdkRectangle rect;
+      
+      rect.x = x;
+      rect.y = y;
+      rect.width = width;
+      rect.height = height;
+      
+      clear_area (text, &rect);
     }
-  return NULL;
+  else if (!already_cleared)
+    gdk_window_clear_area (text->text_area, x, y, width, height);
 }
 
 static void
@@ -4609,7 +4618,7 @@ draw_line (GtkText* text,
   gint len = 0;
   guint running_offset = lp->tab_cont.pixel_offset;
   guchar* buffer;
-  GdkGC *fg_gc, *bg_gc;
+  GdkGC *fg_gc;
   
   GtkEditable *editable = GTK_EDITABLE(text);
   
@@ -4645,27 +4654,8 @@ draw_line (GtkText* text,
   
   if (running_offset > 0)
     {
-      bg_gc = mark_bg_gc (text, &mark);
-      
-      if (bg_gc)
-       gdk_draw_rectangle (text->text_area,
-                           bg_gc,
-                           TRUE,
-                           0,
-                           pixel_start_height,
-                           running_offset,
-                           LINE_HEIGHT (*lp));
-      else if (GTK_WIDGET (text)->style->bg_pixmap[GTK_STATE_NORMAL])
-       {
-         GdkRectangle rect;
-         
-         rect.x = 0;
-         rect.y = pixel_start_height;
-         rect.width = running_offset;
-         rect.height = LINE_HEIGHT (*lp);
-         
-         clear_area (text, &rect);
-       }
+      draw_bg_rect (text, &mark, 0, pixel_start_height, running_offset,
+                   LINE_HEIGHT (*lp), TRUE);
     }
   
   for (; chars > 0; chars -= len, buffer += len, len = 0)
@@ -4697,26 +4687,8 @@ draw_line (GtkText* text,
          else
            pixel_width = gdk_text_width (font, (gchar*) buffer, len);
          
-         bg_gc = mark_bg_gc (text, &mark);
-         if (bg_gc)
-           gdk_draw_rectangle (text->text_area,
-                               bg_gc,
-                               TRUE,
-                               running_offset,
-                               pixel_start_height,
-                               pixel_width,
-                               LINE_HEIGHT(*lp));
-         else if (GTK_WIDGET (text)->style->bg_pixmap[GTK_STATE_NORMAL])
-           {
-             GdkRectangle rect;
-             
-             rect.x = running_offset;
-             rect.y = pixel_start_height;
-             rect.width = pixel_width;
-             rect.height = LINE_HEIGHT (*lp);
-             
-             clear_area (text, &rect);
-           }
+         draw_bg_rect (text, &mark, running_offset, pixel_start_height,
+                       pixel_width, LINE_HEIGHT (*lp), TRUE);
          
          if ((mark.index >= selection_start_pos) && 
              (mark.index < selection_end_pos))
@@ -4745,32 +4717,23 @@ draw_line (GtkText* text,
        }
       else
        {
+         gint pixels_remaining;
+         gint space_width;
+         gint spaces_avail;
+             
          len = 1;
          
-         bg_gc = mark_bg_gc (text, &mark);
-         if (bg_gc)
-           {
-             gint pixels_remaining;
-             gint space_width;
-             gint spaces_avail;
-             
-             gdk_window_get_size (text->text_area, &pixels_remaining, NULL);
-             pixels_remaining -= (LINE_WRAP_ROOM + running_offset);
+         gdk_window_get_size (text->text_area, &pixels_remaining, NULL);
+         pixels_remaining -= (LINE_WRAP_ROOM + running_offset);
+         
+         space_width = MARK_CURRENT_TEXT_FONT(text, &mark)->char_widths[' '];
+         
+         spaces_avail = pixels_remaining / space_width;
+         spaces_avail = MIN (spaces_avail, tab_mark.to_next_tab);
 
-             space_width = MARK_CURRENT_TEXT_FONT(text, &mark)->char_widths[' '];
+         draw_bg_rect (text, &mark, running_offset, pixel_start_height,
+                       spaces_avail * space_width, LINE_HEIGHT (*lp), TRUE);
 
-             spaces_avail = pixels_remaining / space_width;
-             spaces_avail = MIN (spaces_avail, tab_mark.to_next_tab);
-             
-             gdk_draw_rectangle (text->text_area,
-                                 bg_gc,
-                                 TRUE,
-                                 running_offset,
-                                 pixel_start_height,
-                                 spaces_avail * space_width,
-                                 LINE_HEIGHT (*lp));
-           }
-         
          running_offset += tab_mark.to_next_tab *
            MARK_CURRENT_TEXT_FONT(text, &mark)->char_widths[' '];
 
@@ -4833,7 +4796,6 @@ static void
 undraw_cursor (GtkText* text, gint absolute)
 {
   GtkEditable *editable = (GtkEditable *)text;
-  GdkGC *gc;
 
   TDEBUG (("in undraw_cursor\n"));
   
@@ -4849,30 +4811,11 @@ undraw_cursor (GtkText* text, gint absolute)
       g_assert(text->cursor_mark.property);
 
       font = MARK_CURRENT_FONT(text, &text->cursor_mark);
-      gc = mark_bg_gc (text, &text->cursor_mark);
 
-      if (!gc && (GTK_WIDGET (text)->style->bg_pixmap[GTK_STATE_NORMAL]))
-       {
-         GdkRectangle rect;
-         
-         rect.x = text->cursor_pos_x;
-         rect.y = text->cursor_pos_y - text->cursor_char_offset - font->ascent;
-         rect.width = 1;
-         rect.height = font->ascent + 1; /* @@@ I add one here because draw_line is inclusive, right? */
-         
-         clear_area (text, &rect);
-       }
-      else
-       {
-         if (!gc)
-           {
-             gdk_gc_set_foreground (text->gc, MARK_CURRENT_BACK (text, &text->cursor_mark));
-             gc = text->gc;
-           }
-         gdk_draw_line (text->text_area, gc, text->cursor_pos_x,
-                        text->cursor_pos_y - text->cursor_char_offset, text->cursor_pos_x,
-                        text->cursor_pos_y - text->cursor_char_offset - font->ascent);
-       }
+      draw_bg_rect (text, &text->cursor_mark, 
+                   text->cursor_pos_x,
+                   text->cursor_pos_y - text->cursor_char_offset - font->ascent,
+                   1, font->ascent + 1, FALSE);
       
       if (text->cursor_char)
        {
diff --git a/gtk/gtkthemes.c b/gtk/gtkthemes.c
new file mode 100644 (file)
index 0000000..d2482a0
--- /dev/null
@@ -0,0 +1,138 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * Themes added by The Rasterman <raster@redhat.com>
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <gmodule.h>
+#include "gtkthemes.h"
+#include "gtkmain.h"
+#include "gtkrc.h"
+#include "gtkselection.h"
+#include "gtksignal.h"
+#include "gtkwidget.h"
+#include "gtkprivate.h"
+#include "config.h"
+
+typedef struct _GtkThemeEnginePrivate GtkThemeEnginePrivate;
+
+struct _GtkThemeEnginePrivate {
+  GtkThemeEngine engine;
+  
+  GModule *library;
+  void *name;
+
+  void (*init) (GtkThemeEngine *);
+  void (*exit) (void);
+
+  guint refcount;
+};
+
+static GHashTable *engine_hash = NULL;
+
+GtkThemeEngine *
+gtk_theme_engine_get (gchar          *name)
+{
+  GtkThemeEnginePrivate *result;
+  
+  if (!engine_hash)
+    engine_hash = g_hash_table_new (g_str_hash, g_str_equal);
+
+  /* get the library name for the theme */
+  
+  result = g_hash_table_lookup (engine_hash, name);
+
+  if (!result)
+    {
+       gchar fullname[1024];
+       gchar *engine_path;
+       GModule *library;
+      
+       g_snprintf (fullname, 1024, "lib%s.so", name);
+       engine_path = gtk_rc_find_module_in_path(NULL, fullname);
+
+       if (!engine_path)
+        return NULL;
+       
+       /* load the lib */
+       
+       printf ("Loading Theme %s\n", engine_path);
+       
+       library = g_module_open (engine_path, 0);
+       g_free(engine_path);
+       if (!library)
+        g_error(g_module_error());
+       else
+        {
+           result = g_new (GtkThemeEnginePrivate, 1);
+           
+           result->refcount = 1;
+           result->name = g_strdup (name);
+           result->library = library;
+           
+           /* extract symbols from the lib */
+           if (!g_module_symbol (library, "theme_init",
+                                 (gpointer *)&result->init) ||
+               !g_module_symbol (library, "theme_exit", 
+                                 (gpointer *)&result->exit))
+             {
+               g_error (g_module_error());
+               g_free (result);
+               return NULL;
+             }
+           
+           /* call the theme's init (theme_init) function to let it */
+           /* setup anything it needs to set up. */
+           result->init((GtkThemeEngine *)result);
+           
+           g_hash_table_insert (engine_hash, result->name, result);
+        }
+    }
+  else
+    result->refcount++;
+
+  return (GtkThemeEngine *)result;
+}
+
+void
+gtk_theme_engine_ref (GtkThemeEngine *engine)
+{
+  g_return_if_fail (engine != NULL);
+  
+  ((GtkThemeEnginePrivate *)engine)->refcount++;
+}
+
+void
+gtk_theme_engine_unref (GtkThemeEngine *engine)
+{
+  GtkThemeEnginePrivate *private;
+
+  g_return_if_fail (engine != NULL);
+
+  private = (GtkThemeEnginePrivate *)engine;
+  private->refcount--;
+
+  if (private->refcount == 0)
+    {
+      g_hash_table_remove (engine_hash, private->name);
+      
+      g_module_close (private->library);
+      g_free (private->name);
+      g_free (private);
+    }
+}
diff --git a/gtk/gtkthemes.h b/gtk/gtkthemes.h
new file mode 100644 (file)
index 0000000..135b17e
--- /dev/null
@@ -0,0 +1,95 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * Themes added by The Rasterman <raster@redhat.com>
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#ifndef __GTK_THEMES_H__
+#define __GTK_THEMES_H__
+
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <gdk/gdk.h>
+#include <gtk/gtkstyle.h>
+#include <gtk/gtkwidget.h>
+
+struct _GtkThemeEngine {
+  /* Fill in engine_data pointer in a GtkRcStyle by parsing contents
+   * of brackets. Returns G_TOKEN_NONE if succesfull, otherwise returns
+   * the token it expected but didn't get.
+   */
+  guint (*parse_rc_style)    (GScanner *scanner, GtkRcStyle *rc_style);
+  
+  /* Combine RC style data from src into dest. If 
+   * dest->engine_data is NULL, it should be initialized to default
+   * values.
+   */
+  void (*merge_rc_style)    (GtkRcStyle *dest,     GtkRcStyle *src);
+
+  /* Fill in style->engine_data from rc_style->engine_data */
+  void (*rc_style_to_style) (GtkStyle   *style, GtkRcStyle *rc_style);
+
+  /* Duplicate engine_data from src to dest. The engine_data will
+   * not subsequently be modified except by a call to realize_style()
+   * so if realize_style() does nothing, refcounting is appropriate.
+   */
+  void (*duplicate_style)   (GtkStyle *dest,       GtkStyle *src);
+
+  /* If style needs to initialize for a particular colormap/depth
+   * combination, do it here. style->colormap/style->depth will have
+   * been set at this point, and style itself initialized for 
+   * the colormap
+   */
+  void (*realize_style) (GtkStyle   *new_style);
+
+  /* If style needs to clean up for a particular colormap/depth
+   * combination, do it here. 
+   */
+  void (*unrealize_style) (GtkStyle   *new_style);
+
+  /* Clean up rc_style->engine_data before rc_style is destroyed */
+  void (*destroy_rc_style)  (GtkRcStyle *rc_style);
+
+  /* Clean up style->engine_data before style is destroyed */
+  void (*destroy_style)     (GtkStyle   *style);
+
+  void (*set_background) (GtkStyle     *style,
+                         GdkWindow    *window,
+                         GtkStateType  state_type);
+};
+
+GtkThemeEngine *gtk_theme_engine_get   (gchar          *name);
+void            gtk_theme_engine_ref   (GtkThemeEngine *engine);
+void            gtk_theme_engine_unref (GtkThemeEngine *engine);
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* Initialization, exit, mainloop and miscellaneous routines
+ */
+void      gtk_themes_init       (int          *argc,
+                                 char       ***argv);
+void      gtk_themes_exit       (gint          error_code);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+
+#endif /* __GTK_THEMES_H__ */
index 2c5b67eafccd4d9d25aa626f7ab6c8eb18a3a852..cd8e6e04e2d83e93d927288516336a8064ad7a82 100644 (file)
@@ -52,10 +52,12 @@ static void gtk_toggle_button_set_arg        (GtkObject            *object,
 static void gtk_toggle_button_get_arg   (GtkObject            *object,
                                          GtkArg               *arg,
                                          guint                 arg_id);
-     
+static void gtk_toggle_button_leave      (GtkButton            *button);
+static void gtk_toggle_button_realize    (GtkWidget            *widget);
+static void gtk_toggle_button_unrealize  (GtkWidget            *widget);
 
 static guint toggle_button_signals[LAST_SIGNAL] = { 0 };
-
+static GtkContainerClass *parent_class = NULL;
 
 GtkType
 gtk_toggle_button_get_type (void)
@@ -95,6 +97,8 @@ gtk_toggle_button_class_init (GtkToggleButtonClass *class)
   container_class = (GtkContainerClass*) class;
   button_class = (GtkButtonClass*) class;
 
+  parent_class = gtk_type_class (GTK_TYPE_BUTTON);
+
   gtk_object_add_arg_type ("GtkToggleButton::active", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_ACTIVE);
   gtk_object_add_arg_type ("GtkToggleButton::draw_indicator", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_DRAW_INDICATOR);
 
@@ -112,6 +116,8 @@ gtk_toggle_button_class_init (GtkToggleButtonClass *class)
   object_class->get_arg = gtk_toggle_button_get_arg;
 
   widget_class->draw_focus = gtk_toggle_button_draw_focus;
+  widget_class->realize = gtk_toggle_button_realize;
+  widget_class->unrealize = gtk_toggle_button_unrealize;
 
   button_class->pressed = gtk_toggle_button_pressed;
   button_class->released = gtk_toggle_button_released;
@@ -208,7 +214,15 @@ gtk_toggle_button_set_mode (GtkToggleButton *toggle_button,
 
   if (toggle_button->draw_indicator != draw_indicator)
     {
-      toggle_button->draw_indicator = draw_indicator;
+      if (GTK_WIDGET_REALIZED(toggle_button))
+       {
+         gtk_widget_unrealize(GTK_WIDGET(toggle_button));
+         toggle_button->draw_indicator = draw_indicator;
+         gtk_widget_realize(GTK_WIDGET(toggle_button));
+         gtk_widget_show(GTK_WIDGET(toggle_button));
+       }
+      else
+       toggle_button->draw_indicator = draw_indicator;
 
       if (GTK_WIDGET_VISIBLE (toggle_button))
        gtk_widget_queue_resize (GTK_WIDGET (toggle_button));
@@ -272,26 +286,16 @@ gtk_toggle_button_draw_focus (GtkWidget *widget)
          width -= 2;
          height -= 2;
        }
-      else
-       {
-         if (GTK_WIDGET_STATE (toggle_button) == GTK_STATE_ACTIVE)
-           gdk_draw_rectangle (widget->window,
-                               widget->style->bg_gc[GTK_WIDGET_STATE (widget)], FALSE,
-                               x + 1, y + 1, width - 4, height - 4);
-         else
-           gdk_draw_rectangle (widget->window,
-                               widget->style->bg_gc[GTK_WIDGET_STATE (widget)], FALSE,
-                               x + 2, y + 2, width - 5, height - 5);
-       }
 
       if (toggle_button->active)
        shadow_type = GTK_SHADOW_IN;
       else
        shadow_type = GTK_SHADOW_OUT;
 
-      gtk_draw_shadow (widget->style, widget->window,
-                      GTK_WIDGET_STATE (widget), shadow_type,
-                      x, y, width, height);
+       gtk_paint_box (widget->style, widget->window,
+                     GTK_WIDGET_STATE (widget), shadow_type,
+                     NULL, widget, "togglebutton",
+                     x, y, width, height);
 
       if (GTK_WIDGET_HAS_FOCUS (widget))
        {
@@ -300,10 +304,11 @@ gtk_toggle_button_draw_focus (GtkWidget *widget)
          width += 2;
          height += 2;
 
-         gdk_draw_rectangle (widget->window,
-                             widget->style->black_gc, FALSE,
-                             x, y, width - 1, height - 1);
+         gtk_paint_focus (widget->style, widget->window,
+                          NULL, widget, "togglebutton",
+                          x, y, width - 1, height - 1);
        }
+       gtk_widget_draw (GTK_BIN (widget)->child, NULL);
     }
 }
 
@@ -433,3 +438,80 @@ gtk_toggle_button_leave (GtkButton *button)
       gtk_widget_queue_draw (GTK_WIDGET (button));
     }
 }
+
+static void
+gtk_toggle_button_realize (GtkWidget *widget)
+{
+  GtkToggleButton *toggle_button;
+  GdkWindowAttr attributes;
+  gint attributes_mask;
+  gint border_width;
+  
+  g_return_if_fail (widget != NULL);
+  g_return_if_fail (GTK_IS_TOGGLE_BUTTON (widget));
+  
+  toggle_button = GTK_TOGGLE_BUTTON (widget);
+  GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
+  
+  border_width = GTK_CONTAINER (widget)->border_width;
+  
+  attributes.window_type = GDK_WINDOW_CHILD;
+  attributes.x = widget->allocation.x + border_width;
+  attributes.y = widget->allocation.y + border_width;
+  attributes.width = widget->allocation.width - border_width * 2;
+  attributes.height = widget->allocation.height - border_width * 2;
+  attributes.event_mask = gtk_widget_get_events (widget);
+  attributes.event_mask |= (GDK_EXPOSURE_MASK |
+                           GDK_BUTTON_PRESS_MASK |
+                           GDK_BUTTON_RELEASE_MASK |
+                           GDK_ENTER_NOTIFY_MASK |
+                           GDK_LEAVE_NOTIFY_MASK);
+
+  if (toggle_button->draw_indicator)
+    {
+      GTK_WIDGET_SET_FLAGS (toggle_button, GTK_NO_WINDOW);
+      attributes.wclass = GDK_INPUT_ONLY;
+      attributes_mask = GDK_WA_X | GDK_WA_Y;
+
+      widget->window = gtk_widget_get_parent_window(widget);
+      gdk_window_ref(widget->window);
+      
+      toggle_button->event_window = 
+       gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
+      gdk_window_show(toggle_button->event_window);
+      gdk_window_set_user_data (toggle_button->event_window, toggle_button);
+    }
+  else
+    {
+      GTK_WIDGET_UNSET_FLAGS (toggle_button, GTK_NO_WINDOW);
+      attributes.wclass = GDK_INPUT_OUTPUT;
+      attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
+      attributes.visual = gtk_widget_get_visual (widget);
+      attributes.colormap = gtk_widget_get_colormap (widget);
+      widget->window = 
+       gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
+      gdk_window_set_user_data (widget->window, toggle_button);
+    }
+  widget->style = gtk_style_attach (widget->style, widget->window);
+}
+  
+static void
+gtk_toggle_button_unrealize (GtkWidget *widget)
+{
+  GtkToggleButton *toggle_button;
+  
+  g_return_if_fail (widget != NULL);
+  g_return_if_fail (GTK_IS_TOGGLE_BUTTON (widget));
+
+  toggle_button = GTK_TOGGLE_BUTTON (widget);
+  
+  if (toggle_button->draw_indicator)
+    {
+      gdk_window_set_user_data (toggle_button->event_window, NULL);
+      gdk_window_destroy (toggle_button->event_window);
+      toggle_button->event_window = NULL;
+    }
+
+  if (GTK_WIDGET_CLASS (parent_class)->unrealize)
+    (* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
+}
index 56dd1c3630b2bc28fc8cc5c67bcf1cb73bbac385..bd216758d1c8200d23c7d8306e2d96d6eff486ca 100644 (file)
@@ -45,6 +45,8 @@ struct _GtkToggleButton
 
   guint active : 1;
   guint draw_indicator : 1;
+  
+  GdkWindow *event_window;
 };
 
 struct _GtkToggleButtonClass
index d74d5f6f9e1e47b0cb9f5a8f795473e878e61686..74cdcbc92bba96a1479fb130521c69a2f20f0cfa 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "gtkmain.h"
 #include "gtkwidget.h"
-#include "gtkwindow.h"
+#include "gtkdrawwindow.h"
 #include "gtksignal.h"
 #include "gtkstyle.h"
 #include "gtktooltips.h"
@@ -43,6 +43,9 @@ static void gtk_tooltips_widget_remove     (GtkWidget   *widget,
 static void gtk_tooltips_set_active_widget (GtkTooltips *tooltips,
                                             GtkWidget   *widget);
 static gint gtk_tooltips_timeout           (gpointer     data);
+static gint gtk_tooltips_expose            (GtkTooltips    *tooltips, 
+                                           GdkEventExpose *event);
+
 static void gtk_tooltips_draw_tips         (GtkTooltips *tooltips);
 
 static GtkDataClass *parent_class;
@@ -171,9 +174,15 @@ gtk_tooltips_force_window (GtkTooltips *tooltips)
 
   if (!tooltips->tip_window)
     {
-      tooltips->tip_window = gtk_window_new (GTK_WINDOW_POPUP);
+      tooltips->tip_window = gtk_draw_window_new (GTK_WINDOW_POPUP);
+      gtk_widget_ref (tooltips->tip_window);
       gtk_window_set_policy (GTK_WINDOW (tooltips->tip_window), FALSE, FALSE, TRUE);
-      gtk_widget_realize (tooltips->tip_window);
+
+      gtk_signal_connect_object (GTK_OBJECT (tooltips->tip_window), 
+                                "expose_event",
+                                GTK_SIGNAL_FUNC (gtk_tooltips_expose), 
+                                GTK_OBJECT (tooltips));
+
       gtk_signal_connect (GTK_OBJECT (tooltips->tip_window),
                          "destroy",
                          gtk_widget_destroyed,
@@ -378,6 +387,49 @@ gtk_tooltips_set_colors (GtkTooltips *tooltips,
     tooltips->background = background;
 }
 
+static gint
+gtk_tooltips_expose (GtkTooltips *tooltips, GdkEventExpose *event)
+{
+  GtkStyle *style;
+  gint y, baseline_skip, gap;
+  GtkTooltipsData *data;
+  GList *el;
+
+  style = tooltips->tip_window->style;
+
+  gap = (style->font->ascent + style->font->descent) / 4;
+  if (gap < 2)
+    gap = 2;
+  baseline_skip = style->font->ascent + style->font->descent + gap;
+
+  data = tooltips->active_tips_data;
+  if (!data)
+    return FALSE;
+
+  gtk_paint_flat_box(style, tooltips->tip_window->window,
+                    GTK_STATE_NORMAL, GTK_SHADOW_OUT, 
+                    NULL, GTK_WIDGET(tooltips->tip_window), "tooltip",
+                    0, 0, -1, -1);
+
+  y = style->font->ascent + 4;
+  
+  for (el = data->row; el; el = el->next)
+    {
+      if (el->data)
+       {
+         gtk_paint_string (style, tooltips->tip_window->window, 
+                           GTK_STATE_NORMAL, 
+                           NULL, GTK_WIDGET(tooltips->tip_window), "tooltip",
+                           4, y, el->data);
+         y += baseline_skip;
+       }
+      else
+       y += baseline_skip / 2;
+    }
+
+  return FALSE;
+}
+
 static void
 gtk_tooltips_draw_tips (GtkTooltips * tooltips)
 {
@@ -407,6 +459,7 @@ gtk_tooltips_draw_tips (GtkTooltips * tooltips)
   if (gap < 2)
     gap = 2;
   baseline_skip = style->font->ascent + style->font->descent + gap;
+
   w = data->width;
   h = 8 - gap;
   for (el = data->row; el; el = el->next)
@@ -432,51 +485,8 @@ gtk_tooltips_draw_tips (GtkTooltips * tooltips)
   else
     y = y + widget->allocation.height + 4;
 
-  gtk_widget_set_usize (tooltips->tip_window, w + 1, h + 1);
+  gtk_widget_set_usize (tooltips->tip_window, w, h);
   gtk_widget_popup (tooltips->tip_window, x, y);
-
-  if (tooltips->gc == NULL)
-    tooltips->gc = gdk_gc_new (tooltips->tip_window->window);
-
-  if (tooltips->background != NULL)
-    {
-      gdk_gc_set_foreground (tooltips->gc, tooltips->background);
-      gdk_gc_set_background (tooltips->gc, tooltips->foreground);
-    }
-  else
-    {
-      gdk_gc_set_foreground (tooltips->gc, &style->bg[GTK_STATE_NORMAL]);
-      gdk_gc_set_background (tooltips->gc, &style->fg[GTK_STATE_NORMAL]);
-    }
-
-  gdk_gc_set_font (tooltips->gc, style->font);
-  gdk_draw_rectangle (tooltips->tip_window->window, tooltips->gc, TRUE, 0, 0, w, h);
-
-  if (tooltips->foreground != NULL)
-    {
-      gdk_gc_set_foreground (tooltips->gc, tooltips->foreground);
-      gdk_gc_set_background (tooltips->gc, tooltips->background);
-    }
-  else
-    {
-      gdk_gc_set_foreground (tooltips->gc, &style->fg[GTK_STATE_NORMAL]);
-      gdk_gc_set_background (tooltips->gc, &style->bg[GTK_STATE_NORMAL]);
-    }
-
-  gdk_draw_rectangle (tooltips->tip_window->window, tooltips->gc, FALSE, 0, 0, w, h);
-  y = style->font->ascent + 4;
-
-  for (el = data->row; el; el = el->next)
-    {
-      if (el->data)
-       {
-         gdk_draw_string (tooltips->tip_window->window, style->font,
-                         tooltips->gc, 4, y, el->data);
-         y += baseline_skip;
-       }
-      else
-       y += baseline_skip / 2;
-    }
 }
 
 static gint
index aa7a112983006f795de969f3f5cc1e6476406f38..a4f57e3d5f3d5f1f14b09221d2cb5ba723589b9e 100644 (file)
@@ -648,23 +648,28 @@ gtk_tree_item_draw (GtkWidget    *widget,
                         GTK_TREE (widget->parent)->current_indent + 2);
       item_area.height = widget->allocation.height;
 
-      if (gdk_rectangle_intersect (&item_area, area, &child_area))
+      if (gdk_rectangle_intersect(&item_area, area, &child_area)) 
        {
-         if (!GTK_WIDGET_IS_SENSITIVE (widget)) 
-           gtk_style_set_background (widget->style, widget->window, 
-                                     GTK_STATE_INSENSITIVE);
-         else if(GTK_TREE(widget->parent)->view_mode == GTK_TREE_VIEW_LINE &&
-                 widget->state == GTK_STATE_SELECTED)
-           gtk_style_set_background (widget->style, widget->window, widget->state);
-         else
-           gdk_window_set_background (widget->window, 
-                                      &widget->style->base[GTK_STATE_NORMAL]);
-         
-         gdk_window_clear_area (widget->window, 
-                                child_area.x, child_area.y,
-                                child_area.width, child_area.height);
-         
-         /*    gtk_tree_item_draw_lines(widget); */
+         if (widget->state == GTK_STATE_NORMAL)
+           {
+             gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
+             gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height);
+           }
+         else 
+           {
+             if (!GTK_WIDGET_IS_SENSITIVE (widget)) 
+               gtk_paint_flat_box(widget->style, widget->window,
+                                  widget->state, GTK_STATE_INSENSITIVE,
+                                  area, widget, "treeitem",
+                                  0, 0, -1, -1);
+             else
+               gtk_paint_flat_box(widget->style, widget->window,
+                                  widget->state, GTK_SHADOW_ETCHED_OUT,
+                                  area, widget, "treeitem",
+                                  0, 0, -1, -1);
+           }
+
+         gtk_tree_item_draw_lines(widget);
          
          if (tree_item->pixmaps_box && 
              GTK_WIDGET_VISIBLE(tree_item->pixmaps_box) &&
@@ -673,66 +678,31 @@ gtk_tree_item_draw (GtkWidget    *widget,
        }
       
       /* draw right side */
-      if (gtk_widget_intersect (bin->child, area, &child_area))
+      if (gtk_widget_intersect (bin->child, area, &child_area)) 
        {
-         if (!GTK_WIDGET_IS_SENSITIVE (widget)) 
-           gtk_style_set_background (widget->style, widget->window, 
-                                     GTK_STATE_INSENSITIVE);
-         else if (widget->state == GTK_STATE_NORMAL)
-           gdk_window_set_background (widget->window, &widget->style->base[GTK_STATE_NORMAL]);
-         else
-           gtk_style_set_background (widget->style, widget->window, widget->state);
-       
-       gdk_window_clear_area (widget->window, child_area.x, child_area.y,
-                              child_area.width+1, child_area.height);
-       
-       if (bin->child && 
-           GTK_WIDGET_VISIBLE(bin->child) &&
-           gtk_widget_intersect (bin->child, area, &child_area))
-         gtk_widget_draw (bin->child, &child_area);
-      }
+         if (bin->child && 
+             GTK_WIDGET_VISIBLE(bin->child) &&
+             gtk_widget_intersect (bin->child, area, &child_area))
+           gtk_widget_draw (bin->child, &child_area);
+       }
+
+      if (GTK_WIDGET_HAS_FOCUS (widget))
+       gtk_paint_focus (widget->style, widget->window,
+                        NULL, widget, "treeitem",
+                        0, 0,
+                        widget->allocation.width - 1,
+                        widget->allocation.height - 1);
       
-      gtk_widget_draw_focus (widget);
     }
 }
 
 static void
 gtk_tree_item_draw_focus (GtkWidget *widget)
 {
-  GdkGC *gc;
-  int dx;
-
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_TREE_ITEM (widget));
 
-  if (GTK_WIDGET_DRAWABLE (widget))
-    {
-      if (GTK_WIDGET_HAS_FOCUS (widget))
-       gc = widget->style->black_gc;
-      else if (!GTK_WIDGET_IS_SENSITIVE (widget))
-       gc = widget->style->bg_gc[GTK_STATE_INSENSITIVE];
-      else if (widget->state == GTK_STATE_NORMAL)
-       gc = widget->style->base_gc[GTK_STATE_NORMAL];
-      else
-       gc = widget->style->bg_gc[widget->state];
-
-      dx = 0;
-
-      if (GTK_TREE(widget->parent)->view_mode == GTK_TREE_VIEW_ITEM) 
-       dx = (GTK_TREE_ITEM(widget)->pixmaps_box->allocation.width + DEFAULT_DELTA +
-             GTK_TREE(widget->parent)->current_indent + 1);
-      
-      gdk_draw_rectangle (widget->window, gc, FALSE, dx, 0,
-                         widget->allocation.width - 1 - dx,
-                         widget->allocation.height - 1);
-
-      if (GTK_TREE (widget->parent)->view_line &&
-        (!GTK_IS_ROOT_TREE (widget->parent) ||
-         (GTK_IS_ROOT_TREE (widget->parent) && GTK_TREE_ITEM(widget)->subtree))) 
-       {
-         gtk_tree_item_draw_lines(widget);
-       }
-    }
+  gtk_widget_draw(widget, NULL);
 }
 
 static gint
@@ -848,7 +818,7 @@ gtk_real_tree_item_toggle (GtkItem *item)
     {
       /* Should we really bother with this bit? A listitem not in a list?
        * -Johannes Keukelaar
-       * yes, always be on the save side!
+       * yes, always be on the safe side!
        * -timj
        */
       if (GTK_WIDGET (item)->state == GTK_STATE_SELECTED)
index 1baf3a8874d81d03f87e4ba1db290dd8445b4164..0ef84889bc93e8b42bca3d19a1df369ad52a776a 100644 (file)
@@ -57,6 +57,8 @@ static void gtk_viewport_adjustment_changed       (GtkAdjustment    *adjustment,
                                                   gpointer          data);
 static void gtk_viewport_adjustment_value_changed (GtkAdjustment    *adjustment,
                                                   gpointer          data);
+static void gtk_viewport_style_set                (GtkWidget *widget,
+                                                  GtkStyle  *previous_style);
 
 static GtkBinClass *parent_class;
 
@@ -122,7 +124,8 @@ gtk_viewport_class_init (GtkViewportClass *class)
   widget_class->expose_event = gtk_viewport_expose;
   widget_class->size_request = gtk_viewport_size_request;
   widget_class->size_allocate = gtk_viewport_size_allocate;
-
+  widget_class->style_set = gtk_viewport_style_set;
+   
   container_class->add = gtk_viewport_add;
 }
 
@@ -438,7 +441,12 @@ gtk_viewport_realize (GtkWidget *widget)
   widget->style = gtk_style_attach (widget->style, widget->window);
   gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
   gtk_style_set_background (widget->style, viewport->bin_window, GTK_STATE_NORMAL);
-  
+
+   gtk_paint_flat_box(widget->style, viewport->bin_window, GTK_STATE_NORMAL,
+                     GTK_SHADOW_NONE,
+                     NULL, widget, "viewportbin",
+                     0, 0, -1, -1);
+   
   gdk_window_show (viewport->bin_window);
   gdk_window_show (viewport->view_window);
 }
@@ -641,6 +649,10 @@ gtk_viewport_size_allocate (GtkWidget     *widget,
                              child_allocation.y,
                              child_allocation.width,
                              child_allocation.height);
+       gtk_paint_flat_box(widget->style, viewport->bin_window, GTK_STATE_NORMAL,
+                         GTK_SHADOW_NONE,
+                         NULL, widget, "viewportbin",
+                         0, 0, -1, -1);
     }
 
   viewport->hadjustment->page_size = child_allocation.width;
@@ -757,3 +769,28 @@ gtk_viewport_adjustment_value_changed (GtkAdjustment *adjustment,
                         child_allocation.y);
     }
 }
+
+static void
+gtk_viewport_style_set (GtkWidget *widget,
+                       GtkStyle  *previous_style)
+{
+   GtkViewport *viewport;
+   
+   if (GTK_WIDGET_REALIZED (widget) &&
+       !GTK_WIDGET_NO_WINDOW (widget))
+     {
+       viewport = GTK_VIEWPORT (widget);
+       
+       gtk_style_set_background (widget->style, viewport->bin_window, GTK_STATE_NORMAL);
+       gtk_style_set_background (widget->style, widget->window, widget->state);
+       gtk_paint_flat_box(widget->style, viewport->bin_window, GTK_STATE_NORMAL,
+                          GTK_SHADOW_NONE,
+                          NULL, widget, "viewportbin",
+                          0, 0, -1, -1);
+       if (GTK_WIDGET_DRAWABLE (widget))
+         {
+            gdk_window_clear (widget->window);
+            gdk_window_clear (viewport->bin_window);
+         }
+     }
+}
index 32bebd5f40100d16d1c15e5fbd66350638a4aebc..55cd2b9bf465915ce112849fae7a643050db5937 100644 (file)
@@ -229,6 +229,8 @@ gtk_vpaned_draw (GtkWidget    *widget,
       paned = GTK_PANED (widget);
       border_width = GTK_CONTAINER (paned)->border_width;
 
+      gdk_window_clear_area (widget->window,
+                            area->x, area->y, area->width, area->height);
       if (paned->child1 &&
          gtk_widget_intersect (paned->child1, area, &child_area))
         gtk_widget_draw (paned->child1, &child_area);
@@ -236,18 +238,10 @@ gtk_vpaned_draw (GtkWidget    *widget,
          gtk_widget_intersect (paned->child2, area, &child_area))
         gtk_widget_draw (paned->child2, &child_area);
 
-      gdk_draw_line (widget->window,
-                    widget->style->dark_gc[widget->state],
-                    0,
-                    border_width + paned->child1_size + paned->gutter_size / 2 - 1,
-                    widget->allocation.width - 1,
-                    border_width + paned->child1_size + paned->gutter_size / 2 - 1);
-      gdk_draw_line (widget->window,
-                    widget->style->light_gc[widget->state],
-                    0,
-                    border_width + paned->child1_size + paned->gutter_size / 2,
-                    widget->allocation.width - 1,
-                    border_width + paned->child1_size + paned->gutter_size / 2);
+      gtk_paint_hline(widget->style, widget->window, GTK_STATE_NORMAL,
+                     area, widget, "vpaned",
+                     0, widget->allocation.width - 1,
+                     border_width + paned->child1_size + paned->gutter_size / 2 - 1);
     }
 }
 
index f19e5eab296d38d561de65c0d56524e7ad31e7c5..3da583548d032ac857b4c0332bcecedf5cc05d6b 100644 (file)
@@ -162,7 +162,13 @@ gtk_vruler_draw_ticks (GtkRuler *ruler)
   width = widget->allocation.height;
   height = widget->allocation.width - ythickness * 2;
 
-  gdk_draw_line (ruler->backing_store, gc,
+   gtk_paint_box (widget->style, ruler->backing_store,
+                 GTK_STATE_NORMAL, GTK_SHADOW_OUT, 
+                 NULL, widget, "vruler",
+                 0, 0, 
+                 widget->allocation.width, widget->allocation.height);
+
+   gdk_draw_line (ruler->backing_store, gc,
                 height + xthickness,
                 ythickness,
                 height + xthickness,
@@ -234,12 +240,6 @@ gtk_vruler_draw_ticks (GtkRuler *ruler)
              for (j = 0; j < (int) strlen (unit_str); j++)
                {
                  digit_str[0] = unit_str[j];
-                 gdk_draw_rectangle (ruler->backing_store,
-                                     bg_gc, TRUE,
-                                     xthickness + 1,
-                                     pos + digit_height * j + 1,
-                                     gdk_string_width(font, digit_str),
-                                     digit_height);
                  gdk_draw_string (ruler->backing_store, font, gc,
                                   xthickness + 1,
                                   pos + digit_height * (j + 1) + 1,
index 5fecac35645c1f7f7a7f4fba6cfba39cce1cfa4f..2bdc33c11f79e54e3ff5d15c652a705ea596634f 100644 (file)
@@ -38,13 +38,20 @@ static void gtk_vscale_pos_trough    (GtkVScale      *vscale,
                                      gint           *y,
                                      gint           *w,
                                      gint           *h);
+static void gtk_vscale_pos_background (GtkVScale     *vscale,
+                                      gint          *x,
+                                      gint          *y,
+                                      gint          *w,
+                                      gint          *h);
 static void gtk_vscale_draw_slider   (GtkRange       *range);
 static void gtk_vscale_draw_value    (GtkScale       *scale);
+static void gtk_vscale_draw          (GtkWidget      *widget,
+                                     GdkRectangle   *area);
 static gint gtk_vscale_trough_keys   (GtkRange *range,
                                      GdkEventKey *key,
                                      GtkScrollType *scroll,
                                      GtkTroughType *pos);
-
+static void gtk_vscale_clear_background (GtkRange    *range);
 
 guint
 gtk_vscale_get_type (void)
@@ -85,12 +92,14 @@ gtk_vscale_class_init (GtkVScaleClass *class)
   widget_class->realize = gtk_vscale_realize;
   widget_class->size_request = gtk_vscale_size_request;
   widget_class->size_allocate = gtk_vscale_size_allocate;
+  widget_class->draw = gtk_vscale_draw;
 
   range_class->slider_update = gtk_range_default_vslider_update;
   range_class->trough_click = gtk_range_default_vtrough_click;
   range_class->motion = gtk_range_default_vmotion;
   range_class->draw_slider = gtk_vscale_draw_slider;
   range_class->trough_keys = gtk_vscale_trough_keys;
+  range_class->clear_background = gtk_vscale_clear_background;
 
   scale_class->draw_value = gtk_vscale_draw_value;
 }
@@ -98,6 +107,7 @@ gtk_vscale_class_init (GtkVScaleClass *class)
 static void
 gtk_vscale_init (GtkVScale *vscale)
 {
+  GTK_WIDGET_SET_FLAGS (vscale, GTK_NO_WINDOW);
 }
 
 GtkWidget*
@@ -130,28 +140,26 @@ gtk_vscale_realize (GtkWidget *widget)
   GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
   range = GTK_RANGE (widget);
 
-  attributes.x = widget->allocation.x;
-  attributes.y = widget->allocation.y;
-  attributes.width = widget->allocation.width;
-  attributes.height = widget->allocation.height;
-  attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.window_type = GDK_WINDOW_CHILD;
-  attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;
-  attributes.visual = gtk_widget_get_visual (widget);
-  attributes.colormap = gtk_widget_get_colormap (widget);
-
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
-  widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
+  widget->window = gtk_widget_get_parent_window (widget);
+  gdk_window_ref (widget->window);
 
   gtk_vscale_pos_trough (GTK_VSCALE (widget), &x, &y, &w, &h);
+
   attributes.x = x;
   attributes.y = y;
   attributes.width = w;
   attributes.height = h;
-  attributes.event_mask |= (GDK_BUTTON_PRESS_MASK |
-                           GDK_BUTTON_RELEASE_MASK |
-                           GDK_ENTER_NOTIFY_MASK |
-                           GDK_LEAVE_NOTIFY_MASK);
+  attributes.wclass = GDK_INPUT_OUTPUT;
+  attributes.event_mask = gtk_widget_get_events (widget) | 
+                             (GDK_EXPOSURE_MASK |
+                             GDK_BUTTON_PRESS_MASK |
+                             GDK_BUTTON_RELEASE_MASK |
+                             GDK_ENTER_NOTIFY_MASK |
+                             GDK_LEAVE_NOTIFY_MASK);
+  attributes.visual = gtk_widget_get_visual (widget);
+  attributes.colormap = gtk_widget_get_colormap (widget);
+
+  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
 
   range->trough = gdk_window_new (widget->window, &attributes, attributes_mask);
 
@@ -164,11 +172,9 @@ gtk_vscale_realize (GtkWidget *widget)
 
   widget->style = gtk_style_attach (widget->style, widget->window);
 
-  gdk_window_set_user_data (widget->window, widget);
   gdk_window_set_user_data (range->trough, widget);
   gdk_window_set_user_data (range->slider, widget);
 
-  gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
   gtk_style_set_background (widget->style, range->trough, GTK_STATE_ACTIVE);
   gtk_style_set_background (widget->style, range->slider, GTK_STATE_NORMAL);
 
@@ -178,6 +184,69 @@ gtk_vscale_realize (GtkWidget *widget)
   gdk_window_show (range->trough);
 }
 
+static void
+gtk_vscale_draw (GtkWidget    *widget,
+                GdkRectangle *area)
+{
+  GtkRange *range;
+  GdkRectangle tmp_area;
+  GdkRectangle child_area;
+  gint x, y, width, height;
+
+  g_return_if_fail (widget != NULL);
+  g_return_if_fail (GTK_IS_RANGE (widget));
+  g_return_if_fail (area != NULL);
+
+  if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget))
+    {
+      range = GTK_RANGE (widget);
+
+      gtk_vscale_pos_background (GTK_VSCALE (widget), &x, &y, &width, &height);
+
+      tmp_area.x = x;
+      tmp_area.y = y;
+      tmp_area.width = width;
+      tmp_area.height = height;
+
+      if (gdk_rectangle_intersect (area, &tmp_area, &child_area))
+       gtk_range_draw_background (range);
+
+      gtk_vscale_pos_trough (GTK_VSCALE (widget), &x, &y, &width, &height);
+
+      tmp_area.x = x;
+      tmp_area.y = y;
+      tmp_area.width = width;
+      tmp_area.height = height;
+
+      if (gdk_rectangle_intersect (area, &tmp_area, &child_area))
+       {
+         gtk_range_draw_trough (range);
+         gtk_range_draw_slider (range);
+         gtk_range_draw_step_forw (range);
+         gtk_range_draw_step_back (range);
+       }
+    }
+}
+
+static void
+gtk_vscale_clear_background (GtkRange    *range)
+{
+  GtkWidget *widget;
+  GtkScale *scale;
+  gint x, y, width, height;
+
+  g_return_if_fail (range != NULL);
+  g_return_if_fail (GTK_IS_SCALE (range));
+
+  widget = GTK_WIDGET (range);
+  scale = GTK_SCALE (range);
+  gtk_vscale_pos_background (GTK_VSCALE (widget), &x, &y, &width, &height);
+
+  gtk_widget_queue_clear_area (GTK_WIDGET (range),
+                              x, y, width, height);
+}
+
 static void
 gtk_vscale_size_request (GtkWidget      *widget,
                         GtkRequisition *requisition)
@@ -236,10 +305,6 @@ gtk_vscale_size_allocate (GtkWidget     *widget,
       range = GTK_RANGE (widget);
       scale = GTK_SCALE (widget);
 
-      gdk_window_move_resize (widget->window,
-                             allocation->x, allocation->y,
-                             allocation->width, allocation->height);
-
       gtk_vscale_pos_trough (GTK_VSCALE (widget), &x, &y, &width, &height);
 
       gdk_window_move_resize (range->trough, x, y, width, height);
@@ -300,13 +365,60 @@ gtk_vscale_pos_trough (GtkVScale *vscale,
     }
   *y += 1;
   *h -= 2;
+
+  *x += widget->allocation.x;
+  *y += widget->allocation.y;
+}
+
+static void
+gtk_vscale_pos_background (GtkVScale *vscale,
+                          gint      *x,
+                          gint      *y,
+                          gint      *w,
+                          gint      *h)
+{
+  GtkWidget *widget;
+  GtkScale *scale;
+
+  gint tx, ty, twidth, theight;
+
+  g_return_if_fail (vscale != NULL);
+  g_return_if_fail (GTK_IS_VSCALE (vscale));
+  g_return_if_fail ((x != NULL) && (y != NULL) && (w != NULL) && (h != NULL));
+
+  gtk_vscale_pos_trough (vscale, &tx, &ty, &twidth, &theight);
+  
+  widget = GTK_WIDGET (vscale);
+  scale = GTK_SCALE (vscale);
+
+  *x = widget->allocation.x;
+  *y = widget->allocation.y;
+  *w = widget->allocation.width;
+  *h = widget->allocation.height;
+
+  switch (scale->value_pos)
+    {
+    case GTK_POS_LEFT:
+      *w -= twidth;
+      break;
+    case GTK_POS_RIGHT:
+      *x = tx;
+      *w -= twidth;
+      break;
+    case GTK_POS_TOP:
+      *h -= theight;
+      break;
+    case GTK_POS_BOTTOM:
+      *y = ty;
+      *h -= theight;
+      break;
+    }
 }
 
 static void
 gtk_vscale_draw_slider (GtkRange *range)
 {
   GtkStateType state_type;
-  gint width, height;
 
   g_return_if_fail (range != NULL);
   g_return_if_fail (GTK_IS_VSCALE (range));
@@ -319,16 +431,11 @@ gtk_vscale_draw_slider (GtkRange *range)
       else
         state_type = GTK_STATE_NORMAL;
 
-      gtk_style_set_background (GTK_WIDGET (range)->style, range->slider, state_type);
-      gdk_window_clear (range->slider);
-
-      gdk_window_get_size (range->slider, &width, &height);
-      gtk_draw_hline (GTK_WIDGET (range)->style, range->slider,
-                     state_type, 1, width - 2, height / 2);
-
-      gtk_draw_shadow (GTK_WIDGET (range)->style, range->slider,
-                       state_type, GTK_SHADOW_OUT,
-                       0, 0, -1, -1);
+       gtk_paint_slider(GTK_WIDGET (range)->style, range->slider, state_type, 
+                       GTK_SHADOW_OUT, 
+                       NULL, GTK_WIDGET (range), "vscale",
+                       0, 0, -1, -1, 
+                       GTK_ORIENTATION_VERTICAL); 
     }
 }
 
@@ -336,6 +443,7 @@ static void
 gtk_vscale_draw_value (GtkScale *scale)
 {
   GtkStateType state_type;
+  GtkWidget *widget;
   gchar buffer[32];
   gint text_width;
   gint width, height;
@@ -344,11 +452,10 @@ gtk_vscale_draw_value (GtkScale *scale)
   g_return_if_fail (scale != NULL);
   g_return_if_fail (GTK_IS_VSCALE (scale));
 
+  widget = GTK_WIDGET (scale);
+  
   if (scale->draw_value)
     {
-      gdk_window_get_size (GTK_WIDGET (scale)->window, &width, &height);
-      gdk_window_clear_area (GTK_WIDGET (scale)->window, 1, 1, width - 3, height - 3);
-
       sprintf (buffer, "%0.*f", GTK_RANGE (scale)->digits, GTK_RANGE (scale)->adjustment->value);
       text_width = gdk_string_measure (GTK_WIDGET (scale)->style->font, buffer);
 
@@ -361,7 +468,7 @@ gtk_vscale_draw_value (GtkScale *scale)
          gdk_window_get_size (GTK_RANGE (scale)->slider, NULL, &height);
 
          x -= SCALE_CLASS (scale)->value_spacing + text_width;
-         y += ((height -
+         y += widget->allocation.y + ((height -
                 (GTK_WIDGET (scale)->style->font->ascent +
                  GTK_WIDGET (scale)->style->font->descent)) / 2 +
                GTK_WIDGET (scale)->style->font->ascent);
@@ -373,7 +480,7 @@ gtk_vscale_draw_value (GtkScale *scale)
          gdk_window_get_size (GTK_RANGE (scale)->slider, NULL, &height);
 
          x += width + SCALE_CLASS (scale)->value_spacing;
-         y += ((height -
+         y += widget->allocation.y + ((height -
                 (GTK_WIDGET (scale)->style->font->ascent +
                  GTK_WIDGET (scale)->style->font->descent)) / 2 +
                GTK_WIDGET (scale)->style->font->ascent);
@@ -400,9 +507,11 @@ gtk_vscale_draw_value (GtkScale *scale)
       if (!GTK_WIDGET_IS_SENSITIVE (scale))
        state_type = GTK_STATE_INSENSITIVE;
 
-      gtk_draw_string (GTK_WIDGET (scale)->style,
-                      GTK_WIDGET (scale)->window,
-                      state_type, x, y, buffer);
+      gtk_paint_string (GTK_WIDGET (scale)->style,
+                       GTK_WIDGET (scale)->window,
+                       state_type, 
+                       NULL, GTK_WIDGET (scale), "vscale",
+                       x, y, buffer);
     }
 }
 
index c8b960a3193a57a5c84d40e5ac591e0b95510441..2e02acf2273dc592163a2fb2f764ec3dbbaf5b68 100644 (file)
@@ -258,9 +258,11 @@ gtk_vscrollbar_draw_step_forw (GtkRange *range)
       else
        shadow_type = GTK_SHADOW_OUT;
 
-      gtk_draw_arrow (GTK_WIDGET (range)->style, range->step_forw,
-                     state_type, shadow_type, GTK_ARROW_DOWN,
-                     TRUE, 0, 0, -1, -1);
+      gtk_paint_arrow (GTK_WIDGET (range)->style, range->step_forw,
+                      state_type, shadow_type, 
+                      NULL, GTK_WIDGET (range), "scrollbar",
+                      GTK_ARROW_DOWN,
+                      TRUE, 0, 0, -1, -1);
     }
 }
 
@@ -290,9 +292,11 @@ gtk_vscrollbar_draw_step_back (GtkRange *range)
       else
        shadow_type = GTK_SHADOW_OUT;
 
-      gtk_draw_arrow (GTK_WIDGET (range)->style, range->step_back,
-                     state_type, shadow_type, GTK_ARROW_UP,
-                     TRUE, 0, 0, -1, -1);
+      gtk_paint_arrow (GTK_WIDGET (range)->style, range->step_back,
+                      state_type, shadow_type, 
+                      NULL, GTK_WIDGET (range), "scrollbar",
+                      GTK_ARROW_UP,
+                      TRUE, 0, 0, -1, -1);
     }
 }
 
index eb70f01af0230163e6e977abdf240f2bc49d8510..dac67f20c818eb375d453bb440dc57d7251511f8 100644 (file)
@@ -83,11 +83,12 @@ gtk_vseparator_expose (GtkWidget      *widget,
   g_return_val_if_fail (event != NULL, FALSE);
 
   if (GTK_WIDGET_DRAWABLE (widget))
-    gtk_draw_vline (widget->style, widget->window, GTK_STATE_NORMAL,
-                   widget->allocation.y,
-                   widget->allocation.y + widget->allocation.height,
-                   widget->allocation.x + (widget->allocation.width -
-                                           widget->style->klass->xthickness) / 2);
+    gtk_paint_vline (widget->style, widget->window, GTK_STATE_NORMAL,
+                    &event->area, widget, "vseparator",
+                    widget->allocation.y,
+                    widget->allocation.y + widget->allocation.height,
+                    widget->allocation.x + (widget->allocation.width -
+                                            widget->style->klass->xthickness) / 2);
 
   return FALSE;
 }
index 234ad3ae032ff0a78b5806ddcceb49e427e82cbb..b8abd70b45f59e472ebe5719b4e238e0e3237bb2 100644 (file)
@@ -150,6 +150,9 @@ static gint gtk_widget_real_key_release_event    (GtkWidget         *widget,
                                                  GdkEventKey       *event);
 static void gtk_widget_style_set                (GtkWidget         *widget,
                                                  GtkStyle          *previous_style);
+
+static void  gtk_widget_redraw_queue_remove       (GtkWidget         *widget);
+
      
 static GdkColormap* gtk_widget_peek_colormap (void);
 static GdkVisual*   gtk_widget_peek_visual   (void);
@@ -199,7 +202,8 @@ static const gchar *shape_info_key = "gtk-shape-info";
 static const gchar *colormap_key = "gtk-colormap";
 static const gchar *visual_key = "gtk-visual";
 
-
+static const gchar *rc_style_key = "gtk-rc-style";
+static guint        rc_style_key_id = 0;
 
 /*****************************************
  * gtk_widget_get_type:
@@ -1210,6 +1214,7 @@ gtk_widget_unparent (GtkWidget *widget)
    * should eventually move into some gtk_window_unparent_branch() or
    * similar function.
    */
+  
   toplevel = gtk_widget_get_toplevel (widget);
   if (GTK_CONTAINER (widget->parent)->focus_child == widget)
     {
@@ -1241,6 +1246,9 @@ gtk_widget_unparent (GtkWidget *widget)
        gtk_window_set_default (GTK_WINDOW (toplevel), NULL);
     }
 
+  if (GTK_WIDGET_REDRAW_PENDING (widget))
+    gtk_widget_redraw_queue_remove (widget);
+
   if (GTK_IS_RESIZE_CONTAINER (widget))
     gtk_container_clear_resize_widgets (GTK_CONTAINER (widget));
   
@@ -1308,15 +1316,10 @@ gtk_widget_unparent (GtkWidget *widget)
 
       toplevel = toplevel->parent;
     }
-  
   if (widget->window &&
       GTK_WIDGET_NO_WINDOW (widget) &&
       GTK_WIDGET_DRAWABLE (widget))
-    gdk_window_clear_area (widget->window,
-                          widget->allocation.x,
-                          widget->allocation.y,
-                          widget->allocation.width,
-                          widget->allocation.height);
+    gtk_widget_queue_clear (widget);
 
   /* Reset the width and height here, to force reallocation if we
    * get added back to a new parent. This won't work if our new
@@ -1605,12 +1608,9 @@ gtk_widget_unrealize (GtkWidget *widget)
 {
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_WIDGET (widget));
-  
+
   if (GTK_WIDGET_REDRAW_PENDING (widget))
-    {
-      gtk_widget_redraw_queue = g_slist_remove (gtk_widget_redraw_queue, widget);
-      GTK_PRIVATE_UNSET_FLAG (widget, GTK_REDRAW_PENDING);
-    }
+    gtk_widget_redraw_queue_remove (widget);
   
   if (GTK_WIDGET_HAS_SHAPE_MASK (widget))
     gtk_widget_shape_combine_mask (widget, NULL, -1, -1);
@@ -1630,45 +1630,495 @@ gtk_widget_unrealize (GtkWidget *widget)
  *   results:
  *****************************************/
 
-static gint
-gtk_widget_idle_draw (gpointer data)
+typedef struct _GtkDrawData GtkDrawData;
+struct _GtkDrawData {
+  GdkRectangle rect;
+  GdkWindow *window;
+};
+
+static GMemChunk   *draw_data_mem_chunk = NULL;
+static GSList      *draw_data_free_list = NULL;
+static const gchar *draw_data_key  = "gtk-draw-data";
+static guint        draw_data_key_id = 0;
+
+static gint gtk_widget_idle_draw (gpointer data);
+
+static void
+gtk_widget_queue_draw_data (GtkWidget *widget,
+                           gint       x,
+                           gint       y,
+                           gint       width,
+                           gint       height,
+                           GdkWindow *window)
 {
-  while (gtk_widget_redraw_queue)
-    gtk_widget_draw (gtk_widget_redraw_queue->data, NULL);
+  GSList      *node;
+  GtkDrawData *data;
+  
+  g_return_if_fail (widget != NULL);
 
-  return FALSE;
+  if ((width != 0) && (height != 0) && GTK_WIDGET_DRAWABLE (widget))
+    {
+      if (!draw_data_key_id)
+       draw_data_key_id = g_quark_from_static_string (draw_data_key);
+      
+      if (draw_data_free_list)
+       {
+         node = draw_data_free_list;
+         data = node->data;
+         draw_data_free_list = draw_data_free_list->next;
+       }
+      else
+       {
+         if (!draw_data_mem_chunk)
+           draw_data_mem_chunk = g_mem_chunk_create (GtkDrawData, 64,
+                                                     G_ALLOC_ONLY);
+         data = g_chunk_new (GtkDrawData, draw_data_mem_chunk);
+         node = g_slist_alloc();
+         node->data = data;
+       }
+
+      data->rect.x = x;
+      data->rect.y = y;
+
+      if ((width < 0) || (height < 0))
+       {
+         data->rect.width = 0;
+         data->rect.height = 0;
+       }
+      else
+       {
+         data->rect.width = width;
+         data->rect.height = height;
+       }
+      data->window = window;
+      
+      if ((width < 0) || (height < 0))
+       {
+         GSList *draw_data_list = 
+           gtk_object_get_data_by_id (GTK_OBJECT (widget),
+                                      draw_data_key_id);
+         if (draw_data_list)
+           draw_data_free_list = g_slist_concat (draw_data_list,
+                                                 draw_data_free_list);
+         node->next = NULL;
+       }
+      else
+       node->next = gtk_object_get_data_by_id (GTK_OBJECT (widget),
+                                               draw_data_key_id);
+
+      if (!GTK_WIDGET_REDRAW_PENDING (widget))
+       {
+         GTK_PRIVATE_SET_FLAG (widget, GTK_REDRAW_PENDING);
+         if (gtk_widget_redraw_queue == NULL)
+           gtk_idle_add_priority (GTK_PRIORITY_INTERNAL,
+                                  gtk_widget_idle_draw,
+                                  NULL);
+         gtk_widget_redraw_queue = g_slist_prepend (gtk_widget_redraw_queue, widget);
+       }
+
+      gtk_object_set_data_by_id (GTK_OBJECT (widget), draw_data_key_id, node);
+    }
 }
 
-void
+void      
+gtk_widget_queue_draw_area (GtkWidget *widget,
+                           gint       x,
+                           gint       y,
+                           gint       width,
+                           gint       height)
+{
+  g_return_if_fail (widget != NULL);
+  g_return_if_fail (GTK_IS_WIDGET (widget));
+
+  gtk_widget_queue_draw_data (widget, x, y, width, height, NULL);
+}
+
+void      
 gtk_widget_queue_draw (GtkWidget *widget)
+{
+  g_return_if_fail (widget != NULL);
+  g_return_if_fail (GTK_IS_WIDGET (widget));
+
+  gtk_widget_queue_draw_data (widget, 0, 0, -1, -1, NULL);
+}
+
+void      
+gtk_widget_queue_clear_area (GtkWidget *widget,
+                            gint       x,
+                            gint       y,
+                            gint       width,
+                            gint       height)
 {
   GtkWidget *parent;
   
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_WIDGET (widget));
-  
-  if (GTK_WIDGET_DRAWABLE (widget))
+
+  /* Find the correct widget */
+
+  if (GTK_WIDGET_NO_WINDOW (widget))
     {
-      /* We queue the redraw if:
-       *  a) the widget is not already queued for redraw and
-       *  b) non of the widgets ancestors are queued for redraw.
-       */
       parent = widget;
-      while (parent)
+      while (parent && GTK_WIDGET_NO_WINDOW (parent))
+       parent = parent->parent;
+      
+      if (parent)
+       gtk_widget_queue_draw_data (parent, x, y, width, height, widget->window);
+    }
+  else
+    {
+      gint wx, wy, wwidth, wheight;
+      /* Translate widget relative to window-relative */
+
+      gdk_window_get_position (widget->window, &wx, &wy);
+      x -= wx - widget->allocation.x;
+      y -= wy - widget->allocation.y;
+
+      gdk_window_get_size (widget->window, &wwidth, &wheight);
+
+      if (x < 0)
        {
-         if (GTK_WIDGET_REDRAW_PENDING (parent))
-           return;
-         parent = parent->parent;
+         width += x;  x = 0;
        }
+      if (y < 0)
+       {
+         height += y; y = 0;
+       }
+      if (x + width > wwidth)
+       width = wwidth - x;
+      if (y + height > wheight)
+       height = wheight - y;
+
+      gtk_widget_queue_draw_data (widget, x, y, width, height, NULL);
+    }
+}
+
+static void
+gtk_widget_redraw_queue_remove (GtkWidget *widget)
+{
+  GSList *draw_data_list;
+  GSList *tmp_list;
+
+  g_return_if_fail (GTK_WIDGET_REDRAW_PENDING (widget));
+
+  gtk_widget_redraw_queue = g_slist_remove (gtk_widget_redraw_queue, widget);
+
+  draw_data_list = gtk_object_get_data_by_id (GTK_OBJECT (widget),
+                                             draw_data_key_id);
+  tmp_list = g_slist_last (draw_data_list);
+  if (tmp_list)
+    {
+      tmp_list->next = draw_data_free_list;
+      draw_data_free_list = draw_data_list;
+    }
+
+  gtk_object_set_data_by_id (GTK_OBJECT (widget),
+                            draw_data_key_id,
+                            NULL);
+  
+  GTK_PRIVATE_UNSET_FLAG (widget, GTK_REDRAW_PENDING);
+}
+
+void      
+gtk_widget_queue_clear   (GtkWidget *widget)
+{
+  g_return_if_fail (widget != NULL);
+  g_return_if_fail (GTK_IS_WIDGET (widget));
+
+  if (GTK_WIDGET_NO_WINDOW (widget))
+    gtk_widget_queue_clear_area (widget, widget->allocation.x,
+                                widget->allocation.y,
+                                widget->allocation.width, 
+                                widget->allocation.height);
+  else
+    gtk_widget_queue_clear_area (widget, 0, 0, 
+                                widget->allocation.width, 
+                                widget->allocation.height);
+}
+
+static gint
+gtk_widget_draw_data_combine (GtkDrawData *parent, GtkDrawData *child)
+{
+  gint parent_x2, parent_y2;
+  gint child_x2, child_y2;
+
+  /* Check for intersection */
+
+  parent_x2 = parent->rect.x + parent->rect.width;
+  child_x2 = child->rect.x + child->rect.width;
+  parent_y2 = parent->rect.y + parent->rect.height;
+  child_y2 = child->rect.y + child->rect.height;
+
+  if ((child->rect.x > parent_x2) || (parent->rect.x > child_x2) ||
+      (child->rect.y > parent_y2) || (parent->rect.y > child_y2))
+    return FALSE;
+  else
+    {
+      parent->rect.x = MIN (parent->rect.x, child->rect.x);
+      parent->rect.y = MIN (parent->rect.y, child->rect.y);
+      parent->rect.width = MAX (parent_x2, child_x2) - parent->rect.x;
+      parent->rect.height = MAX (parent_y2, child_y2) - parent->rect.y;
+    }
+
+  return TRUE;
+}
+
+/* Take a rectangle with respect to window, and translate it
+ * to coordinates relative to widget's allocation, clipping through
+ * intermediate windows. Returns whether translation failed. If the
+ * translation failed, we have something like a handlebox, where
+ * the child widget's GdkWindow is not a child of the parents GdkWindow.
+ */
+static gboolean
+gtk_widget_clip_rect (GtkWidget *widget,
+                     GdkWindow *window,
+                     GdkRectangle *rect,
+                     gint      *x_offset,
+                     gint      *y_offset)
+{
+  gint x,y, width, height;
+
+  while (window && (window != widget->window))
+    {
+      gdk_window_get_position (window, &x, &y);
+      rect->x += x;
+      if (x_offset)
+       *x_offset += x;
+      rect->y += y;
+      if (y_offset)
+       *y_offset += y;
       
-      GTK_PRIVATE_SET_FLAG (widget, GTK_REDRAW_PENDING);
-      if (gtk_widget_redraw_queue == NULL)
-       gtk_idle_add_priority (GTK_PRIORITY_INTERNAL,
-                              gtk_widget_idle_draw,
-                              NULL);
+      window = gdk_window_get_parent (window);
+      if (!window)
+       return FALSE;
 
-      gtk_widget_redraw_queue = g_slist_prepend (gtk_widget_redraw_queue, widget);
+      gdk_window_get_size (window, &width, &height);
+      
+      if (rect->x < 0)
+       {
+         rect->width += rect->x;
+         rect->x = 0;
+       }
+      if (rect->y < 0)
+       {
+         rect->height += rect->y;
+         rect->y = 0;
+       }
+      if (rect->x + rect->width > width)
+       rect->width = width - rect->x;
+      if (rect->y + rect->height > height)
+       rect->height = height - rect->y;
     }
+
+  if (!window)
+    return FALSE;
+
+  if (!GTK_WIDGET_NO_WINDOW (widget))
+    {
+      if (gdk_window_get_toplevel (window) != window)
+       {
+         gdk_window_get_position (window, &x, &y);
+         rect->x += x - widget->allocation.x;
+         if (x_offset)
+           *x_offset += x - widget->allocation.x;
+         rect->y += y - widget->allocation.y;
+         if (y_offset)
+           *y_offset += y - widget->allocation.y;
+       }
+    }
+
+  return TRUE;
+}
+
+static gint
+gtk_widget_idle_draw (gpointer data)
+{
+  GSList *widget_list;
+  GSList *draw_data_list;
+  GtkWidget *widget;
+  
+  /* Translate all draw requests to be allocation-relative */
+  widget_list = gtk_widget_redraw_queue;
+  while (widget_list)
+    {
+      widget = widget_list->data;
+      draw_data_list = gtk_object_get_data_by_id (GTK_OBJECT (widget),
+                                                 draw_data_key_id);
+
+      while (draw_data_list)
+       {
+         gboolean full_allocation = FALSE;
+         GtkDrawData *data = draw_data_list->data;
+
+         if (data->window)
+           {
+             /* If the translation fails, we have a handlebox,
+              * so redraw the whole widget. Could be done better?
+              */
+             full_allocation = !gtk_widget_clip_rect (widget, 
+                                                      data->window, 
+                                                      &data->rect,
+                                                      NULL, NULL);
+             data->window = NULL;
+           }
+         else
+           {
+             if ((data->rect.width == 0) && (data->rect.height == 0))
+               {
+                 if (GTK_WIDGET_NO_WINDOW (widget))
+                   {
+                     data->rect.x = widget->allocation.x;
+                     data->rect.y = widget->allocation.y;
+                   }
+                 else
+                   {
+                     data->rect.x = 0;
+                     data->rect.y = 0;
+                   }
+                 data->rect.width = widget->allocation.width;
+                 data->rect.height = widget->allocation.height;
+               }
+           }
+
+         draw_data_list = draw_data_list->next;
+       }
+
+      widget_list = widget_list->next;
+    }
+
+  /* Coalesce redraws
+   */
+  widget_list = gtk_widget_redraw_queue;
+  while (widget_list)
+    {
+      GSList *prev_node = NULL;
+      widget = widget_list->data;
+      draw_data_list = gtk_object_get_data_by_id (GTK_OBJECT (widget),
+                                                 draw_data_key_id);
+
+      while (draw_data_list)
+       {
+         gint x_offset, y_offset;
+         GtkDrawData *data = draw_data_list->data;
+         GSList *parent_list = draw_data_list->next;
+         GtkWidget *parent;
+         GdkWindow *window;
+
+         x_offset = 0;
+         y_offset = 0;
+         
+         parent = widget;
+         while (parent)
+           {
+             while (parent_list)
+               {
+                 if (gtk_widget_draw_data_combine (parent_list->data, data))
+                   {
+                     GSList *tmp;
+                     if (prev_node)
+                       prev_node->next = draw_data_list->next;
+                     else
+                       gtk_object_set_data_by_id (GTK_OBJECT (widget),
+                                                  draw_data_key_id,
+                                                  draw_data_list->next);
+
+                     tmp = draw_data_list->next;
+                     draw_data_list->next = draw_data_free_list;
+                     draw_data_free_list = draw_data_list;
+                     draw_data_list = tmp;
+
+                     goto next_rect;
+                   }
+                 
+                 parent_list = parent_list->next;
+               }
+
+             window = parent->window;
+
+             if (parent->parent && parent->parent->window != window)
+               {
+                 if (!GTK_WIDGET_NO_WINDOW (parent))
+                   {
+                     gint x, y;
+                     gdk_window_get_position (window, &x, &y);
+                     data->rect.x -= x - parent->allocation.x;
+                     x_offset -=  x - parent->allocation.x;
+                     data->rect.y -= y - parent->allocation.y;
+                     y_offset -=  y - parent->allocation.y;
+                   }
+                 /* If we can't translate the rectangle, stop trying to
+                  * merge. (This occurs for a handlebox)
+                  */
+                 if (!gtk_widget_clip_rect (parent->parent, window, &data->rect,
+                                            &x_offset, &y_offset))
+                   parent = NULL;
+               }
+
+             if (parent)
+               parent = parent->parent;
+             
+             if (parent && GTK_WIDGET_REDRAW_PENDING (parent))
+               parent_list = gtk_object_get_data_by_id (GTK_OBJECT (parent),
+                                                        draw_data_key_id);
+             else
+               parent_list = NULL;
+           }
+
+         /* OK, this rectangle stays around. But take advantage
+          * of the work we've done to clip it to the visible area -
+          * rect.width/height have already been appropriately 
+          * decreased
+          */
+         data->rect.x -= x_offset;
+         data->rect.y -= y_offset;
+
+
+         prev_node = draw_data_list;
+
+         draw_data_list = draw_data_list->next;
+       next_rect:
+         continue;
+       }
+      widget_list = widget_list->next;
+    }
+
+  /* Process the draws */
+  
+  widget_list = gtk_widget_redraw_queue;
+
+  while (widget_list)
+    {
+      widget = widget_list->data;
+      draw_data_list = gtk_object_get_data_by_id (GTK_OBJECT (widget),
+                                                 draw_data_key_id);
+      gtk_object_set_data_by_id (GTK_OBJECT (widget),
+                                draw_data_key_id,
+                                NULL);
+
+      GTK_PRIVATE_UNSET_FLAG (widget, GTK_REDRAW_PENDING);
+
+      while (draw_data_list)
+       {
+         GtkDrawData *data = draw_data_list->data;
+         gtk_widget_draw (widget, &data->rect);
+         
+         if (draw_data_list->next)
+           draw_data_list = draw_data_list->next;
+         else
+           {
+             draw_data_list->next = draw_data_free_list;
+             draw_data_free_list = draw_data_list;
+             break;
+           }
+       }
+
+      widget_list = widget_list->next;
+    }
+
+  g_slist_free (gtk_widget_redraw_queue);
+  gtk_widget_redraw_queue = NULL;
+
+  return FALSE;
 }
 
 void
@@ -1703,14 +2153,6 @@ gtk_widget_draw (GtkWidget    *widget,
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  if (GTK_WIDGET_REDRAW_PENDING (widget))
-    {
-      gtk_widget_redraw_queue = g_slist_remove (gtk_widget_redraw_queue, widget);
-      GTK_PRIVATE_UNSET_FLAG (widget, GTK_REDRAW_PENDING);
-
-      area = NULL;
-    }
-
   if (GTK_WIDGET_DRAWABLE (widget))
     {
       if (!area)
@@ -2139,9 +2581,13 @@ gtk_widget_event (GtkWidget *widget,
       signal_num = CLIENT_EVENT;
       break;
     case GDK_EXPOSE:
-      /* there is no sense in providing a widget with bogus expose events
+      /* there is no sense in providing a widget with bogus expose events.
+       * Widgets that are going to be resized don't need to be
+       * exposed, since they will be redrawn anyways.
        */
-      if (!event->any.window)
+      if (!event->any.window ||
+         GTK_WIDGET_RESIZE_NEEDED (widget) ||
+         (widget->parent && GTK_WIDGET_RESIZE_NEEDED (widget->parent)))
        {
          gtk_widget_unref (widget);
          return TRUE;
@@ -2534,7 +2980,9 @@ gtk_widget_set_state (GtkWidget           *widget,
        data.parent_sensitive = TRUE;
 
       gtk_widget_propagate_state (widget, &data);
-      gtk_widget_queue_draw (widget);
+  
+      if (GTK_WIDGET_DRAWABLE (widget))
+       gtk_widget_queue_clear (widget);
     }
 }
 
@@ -2581,7 +3029,8 @@ gtk_widget_set_sensitive (GtkWidget *widget,
     data.parent_sensitive = TRUE;
 
   gtk_widget_propagate_state (widget, &data);
-  gtk_widget_queue_draw (widget);
+  if (GTK_WIDGET_DRAWABLE (widget))
+    gtk_widget_queue_clear (widget);
 }
 
 /*****************************************
@@ -2745,6 +3194,24 @@ gtk_widget_get_style (GtkWidget *widget)
   return widget->style;
 }
 
+void       
+gtk_widget_modify_style (GtkWidget      *widget,
+                        GtkRcStyle     *style)
+{
+  GtkRcStyle *old_style;
+  
+  if (!rc_style_key_id)
+    rc_style_key_id = g_quark_from_static_string (rc_style_key);
+
+  old_style = gtk_object_get_data_by_id (GTK_OBJECT (widget), rc_style_key_id);
+
+  if (style != old_style)
+    gtk_object_set_data_by_id_full (GTK_OBJECT (widget),
+                                   rc_style_key_id,
+                                   style,
+                                   (GtkDestroyNotify)gtk_rc_style_unref);
+}
+
 static void
 gtk_widget_style_set (GtkWidget *widget,
                      GtkStyle  *previous_style)
@@ -2764,12 +3231,15 @@ gtk_widget_set_style_internal (GtkWidget *widget,
                               gboolean   initial_emission)
 {
   g_return_if_fail (widget != NULL);
+  g_return_if_fail (GTK_IS_WIDGET (widget));
   g_return_if_fail (style != NULL);
   
   if (widget->style != style)
     {
       GtkStyle *previous_style;
 
+      if (GTK_WIDGET_REALIZED (widget))
+       gtk_reset_widget_shapes(widget);
       if (GTK_WIDGET_REALIZED (widget))
        gtk_style_detach (widget->style);
       
@@ -2796,7 +3266,7 @@ gtk_widget_set_style_internal (GtkWidget *widget,
              (old_requisition.height != widget->requisition.height))
            gtk_widget_queue_resize (widget);
          else if (GTK_WIDGET_DRAWABLE (widget))
-           gtk_widget_queue_draw (widget);
+           gtk_widget_queue_clear (widget);
        }
     }
   else if (initial_emission)
@@ -3699,11 +4169,7 @@ gtk_widget_real_unmap (GtkWidget *widget)
       GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
       
       if (GTK_WIDGET_NO_WINDOW (widget))
-       gdk_window_clear_area (widget->window,
-                              widget->allocation.x,
-                              widget->allocation.y,
-                              widget->allocation.width,
-                              widget->allocation.height);
+       gtk_widget_queue_clear (widget);
       else
        gdk_window_hide (widget->window);
     }
@@ -3825,7 +4291,7 @@ gtk_widget_real_size_allocate (GtkWidget     *widget,
 {
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_WIDGET (widget));
-  
+
   if (GTK_WIDGET_NO_WINDOW (widget) &&
       GTK_WIDGET_MAPPED (widget) &&
       ((widget->allocation.x != allocation->x) ||
@@ -3834,19 +4300,17 @@ gtk_widget_real_size_allocate (GtkWidget     *widget,
        (widget->allocation.height != allocation->height)) &&
       (widget->allocation.width != 0) &&
       (widget->allocation.height != 0))
-    gdk_window_clear_area (widget->window,
-                          widget->allocation.x,
-                          widget->allocation.y,
-                          widget->allocation.width,
-                          widget->allocation.height);
+    gtk_widget_queue_clear (widget);
   
   widget->allocation = *allocation;
   
   if (GTK_WIDGET_REALIZED (widget) &&
       !GTK_WIDGET_NO_WINDOW (widget))
-    gdk_window_move_resize (widget->window,
-                           allocation->x, allocation->y,
-                           allocation->width, allocation->height);
+     {
+       gdk_window_move_resize (widget->window,
+                               allocation->x, allocation->y,
+                               allocation->width, allocation->height);
+     }
 }
 
 /*****************************************
index c2e74f9f8d0b44768b5da328e2fda412b4d0707e..24bbda0be4be6bc9916a0c3042e13d0ffb892323 100644 (file)
@@ -19,7 +19,6 @@
 #ifndef __GTK_WIDGET_H__
 #define __GTK_WIDGET_H__
 
-
 #include <gdk/gdk.h>
 #include <gtk/gtkaccelgroup.h>
 #include <gtk/gtkobject.h>
@@ -100,7 +99,6 @@ typedef enum
 typedef struct _GtkRequisition   GtkRequisition;
 typedef struct _GtkAllocation    GtkAllocation;
 typedef struct _GtkSelectionData GtkSelectionData;
-typedef struct _GtkWidget        GtkWidget;
 typedef struct _GtkWidgetClass   GtkWidgetClass;
 typedef struct _GtkWidgetAuxInfo  GtkWidgetAuxInfo;
 typedef struct _GtkWidgetShapeInfo GtkWidgetShapeInfo;
@@ -419,7 +417,22 @@ void          gtk_widget_map                 (GtkWidget           *widget);
 void      gtk_widget_unmap               (GtkWidget           *widget);
 void      gtk_widget_realize             (GtkWidget           *widget);
 void      gtk_widget_unrealize           (GtkWidget           *widget);
+
+/* Queuing draws */
 void      gtk_widget_queue_draw          (GtkWidget           *widget);
+void      gtk_widget_queue_draw_area     (GtkWidget           *widget,
+                                          gint                 x,
+                                          gint                 y,
+                                          gint                 width,
+                                          gint                 height);
+void      gtk_widget_queue_clear         (GtkWidget           *widget);
+void      gtk_widget_queue_clear_area    (GtkWidget           *widget,
+                                          gint                 x,
+                                          gint                 y,
+                                          gint                 width,
+                                          gint                 height);
+
+
 void      gtk_widget_queue_resize        (GtkWidget           *widget);
 void      gtk_widget_draw                (GtkWidget           *widget,
                                           GdkRectangle        *area);
@@ -520,6 +533,9 @@ void           gtk_widget_ensure_style      (GtkWidget      *widget);
 GtkStyle*  gtk_widget_get_style                (GtkWidget      *widget);
 void      gtk_widget_restore_default_style (GtkWidget  *widget);
 
+void       gtk_widget_modify_style      (GtkWidget      *widget,
+                                        GtkRcStyle     *style);
+
 /* Descend recursively and set rc-style on all widgets without user styles */
 void       gtk_widget_reset_rc_styles   (GtkWidget      *widget);
 
index 6c44b79b93849fcc4bf52a7ceb7bc088f6ff7fd5..97ec38c05c21831a15f7960ded28a5ed2ca37465 100644 (file)
@@ -89,6 +89,14 @@ static void gtk_window_set_hints          (GtkWidget         *widget,
 
 static void gtk_window_read_rcfiles       (GtkWidget         *widget,
                                           GdkEventClient    *event);
+static void gtk_window_draw           (GtkWidget        *widget,
+                                      GdkRectangle     *area);
+static gint gtk_window_expose         (GtkWidget        *widget,
+                                      GdkEventExpose   *event);
+static void gtk_window_style_set      (GtkWidget *widget,
+                                      GtkStyle  *previous_style);
+
+
 
 
 static GtkBinClass *parent_class = NULL;
@@ -173,7 +181,11 @@ gtk_window_class_init (GtkWindowClass *klass)
   widget_class->focus_in_event = gtk_window_focus_in_event;
   widget_class->focus_out_event = gtk_window_focus_out_event;
   widget_class->client_event = gtk_window_client_event;
+  widget_class->style_set = gtk_window_style_set;
 
+  widget_class->draw = gtk_window_draw;
+  widget_class->expose_event = gtk_window_expose;
+   
   container_class->check_resize = gtk_window_check_resize;
 
   klass->set_focus = gtk_real_window_set_focus;
@@ -567,13 +579,13 @@ gtk_window_realize (GtkWidget *widget)
   GtkWindow *window;
   GdkWindowAttr attributes;
   gint attributes_mask;
-
+  
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_WINDOW (widget));
-
+  
   GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
   window = GTK_WINDOW (widget);
-
+  
   switch (window->type)
     {
     case GTK_WINDOW_TOPLEVEL:
@@ -586,7 +598,7 @@ gtk_window_realize (GtkWidget *widget)
       attributes.window_type = GDK_WINDOW_TEMP;
       break;
     }
-
+   
   attributes.title = window->title;
   attributes.wmclass_name = window->wmclass_name;
   attributes.wmclass_class = window->wmclass_class;
@@ -602,16 +614,17 @@ gtk_window_realize (GtkWidget *widget)
                            GDK_LEAVE_NOTIFY_MASK |
                            GDK_FOCUS_CHANGE_MASK |
                            GDK_STRUCTURE_MASK);
-
+   
   attributes_mask = GDK_WA_VISUAL | GDK_WA_COLORMAP;
   attributes_mask |= (window->title ? GDK_WA_TITLE : 0);
   attributes_mask |= (window->wmclass_name ? GDK_WA_WMCLASS : 0);
-
+   
   widget->window = gdk_window_new (NULL, &attributes, attributes_mask);
   gdk_window_set_user_data (widget->window, window);
 
   widget->style = gtk_style_attach (widget->style, widget->window);
   gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
+  gtk_window_paint (widget, NULL);
 }
 
 static void
@@ -949,25 +962,49 @@ gtk_window_focus_out_event (GtkWidget     *widget,
   return FALSE;
 }
 
+static GdkAtom atom_rcfiles = GDK_NONE;
+
 static void
 gtk_window_read_rcfiles (GtkWidget *widget,
                         GdkEventClient *event)
 {
-  GList *toplevels;
-  
+  GList *embedded_windows;
+
+  embedded_windows = gtk_object_get_data (GTK_OBJECT (widget), "gtk-embedded");
+  if (embedded_windows)
+    {
+      GdkEventClient sev;
+      int i;
+      
+      for(i = 0; i < 5; i++)
+       sev.data.l[i] = 0;
+      sev.data_format = 32;
+      sev.message_type = atom_rcfiles;
+      
+      while (embedded_windows)
+       {
+         guint xid = GPOINTER_TO_UINT (embedded_windows->data);
+         gdk_event_send_client_message ((GdkEvent *) &sev, xid);
+         embedded_windows = embedded_windows->next;
+       }
+    }
+
   if (gtk_rc_reparse_all ())
     {
-      toplevels = gdk_window_get_toplevels();
+      /* If the above returned true, some of our RC files are out
+       * of date, so we need to reset all our widgets. Our other
+       * toplevel windows will also get the message, but by
+       * then, the RC file will up to date, so we have to tell
+       * them now.
+       */
+      GList *toplevels;
+      
+      toplevels = gtk_container_get_toplevels();
       while (toplevels)
        {
-         gdk_window_get_user_data (toplevels->data, (gpointer*) &widget);
-         
-         if (widget)
-           gtk_widget_reset_rc_styles (widget);
-         
+         gtk_widget_reset_rc_styles (toplevels->data);
          toplevels = toplevels->next;
        }
-      g_list_free (toplevels);
     }
 }
 
@@ -975,7 +1012,6 @@ static gint
 gtk_window_client_event (GtkWidget     *widget,
                         GdkEventClient *event)
 {
-  static GdkAtom atom_rcfiles = GDK_NONE;
   g_return_val_if_fail (widget != NULL, FALSE);
   g_return_val_if_fail (GTK_IS_WINDOW (widget), FALSE);
   g_return_val_if_fail (event != NULL, FALSE);
@@ -1136,7 +1172,7 @@ gtk_window_move_resize (GtkWindow *window)
        * keep track of what changed
        */
       GtkAllocation allocation;
-
+      
       allocation.x = 0;
       allocation.y = 0;
       allocation.width = widget->requisition.width;
@@ -1148,7 +1184,7 @@ gtk_window_move_resize (GtkWindow *window)
     {
       if ((x != -1) && (y != -1))
        gdk_window_move (widget->window, x, y);
-
+      
       gtk_container_resize_children (GTK_CONTAINER (window));
     }
 }
@@ -1235,3 +1271,59 @@ gtk_window_set_hints (GtkWidget      *widget,
        }
     }
 }
+
+static void
+gtk_window_paint (GtkWidget     *widget,
+                 GdkRectangle *area)
+{
+  gtk_paint_flat_box (widget->style, widget->window, GTK_STATE_NORMAL, 
+                     GTK_SHADOW_NONE, area, widget, "base", 0, 0, -1, -1);
+}
+
+static gint
+gtk_window_expose (GtkWidget      *widget,
+                  GdkEventExpose *event)
+{
+  g_return_val_if_fail (widget != NULL, FALSE);
+  g_return_val_if_fail (GTK_IS_WINDOW (widget), FALSE);
+  g_return_val_if_fail (event != NULL, FALSE);
+
+  gtk_window_paint (widget, &event->area);
+  
+  if (GTK_WIDGET_CLASS (parent_class)->expose_event)
+    return (* GTK_WIDGET_CLASS (parent_class)->expose_event) (widget, event);
+
+  return FALSE;
+}
+
+static void
+gtk_window_draw (GtkWidget    *widget,
+                GdkRectangle *area)
+{
+  gtk_window_paint (widget, area);
+  
+  if (GTK_WIDGET_CLASS (parent_class)->draw)
+    (* GTK_WIDGET_CLASS (parent_class)->draw) (widget, area);
+}
+
+static void
+gtk_window_style_set (GtkWidget *widget,
+                     GtkStyle  *previous_style)
+{
+   GdkRectangle area;
+   
+   if (GTK_WIDGET_REALIZED (widget) &&
+       !GTK_WIDGET_NO_WINDOW (widget))
+     {
+       gtk_style_set_background (widget->style, widget->window, widget->state);
+
+       area.x = 0;
+       area.y = 0;
+       area.width = widget->allocation.width;
+       area.height = widget->allocation.height;
+       gtk_window_draw(widget, &area);
+
+       if (GTK_WIDGET_DRAWABLE (widget))
+         gdk_window_clear (widget->window);
+     }
+}
index 1aafdbc2c2f27a047d09b01ccc0292ffab109a6a..e16ee72b65ce663670cbf63bebbc13a5fb065796 100644 (file)
@@ -1867,10 +1867,7 @@ create_pixmap (void)
       button = gtk_button_new ();
       gtk_box_pack_start (GTK_BOX (box2), button, FALSE, FALSE, 0);
 
-      style = gtk_widget_get_style(button);
-
-      pixmap = gdk_pixmap_create_from_xpm (window->window, &mask, 
-                                          &style->bg[GTK_STATE_NORMAL],
+      pixmap = gdk_pixmap_create_from_xpm (window->window, &mask, NULL,
                                           "test.xpm");
       pixmapwid = gtk_pixmap_new (pixmap, mask);
       gdk_pixmap_unref (pixmap);
index e4e6ba72c705f829f0ad63bfbcadc3e2628bf31d..36bb12464292137e1742d8b7e4bdb4328b9f3a36 100644 (file)
 # widget <widget_set> style <style_name>
 # widget_class <widget_class_set> style <style_name>
 
-# testgtkrc2 sets all the buttons in the main window to blue by default
-include "testgtkrc2"
+include "/opt/themes/share/themes/Metal/gtk/gtkrc"
+#include "/home/otaylor/.themes/Ignorant/gtk/gtkrc"
 
-pixmap_path "."
-
-style "default"
-{
+style "defaultfont" {
+#  font = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*,*"
 #  fontset = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*,*"
-  font = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*"
-}
-
-style "window"
-{
-#  bg_pixmap[NORMAL] = "warning.xpm"
-}
-
-style "scale"
-{
-  fg[NORMAL] = { 1.0, 0, 0 }
-  bg_pixmap[NORMAL] = "<parent>"
-}
-
-style "button" = "default"
-{
-#  fg[PRELIGHT] = { 1.0, 1.0, 1.0 }
-#  bg[PRELIGHT] = { 0, 0, 0.75 }
-#  bg[PRELIGHT] = { 0.75, 0, 0x00 }
-}
-
-style "toggle_button" = "button"
-{
-  fg[NORMAL] = { 1.0, 0, 0 }
-  fg[ACTIVE] = { 1.0, 0, 0 }
-  bg_pixmap[NORMAL] = "<parent>"
-}
-
-style "text"
-{
-  bg_pixmap[NORMAL] = "marble.xpm"
-  text[NORMAL] = { 1.0, 1.0, 1.0 }
-  fg[NORMAL] = { 1.0, 1.0, 1.0 }
-  base[NORMAL] = { 0.0, 0.0, 0.0 }
 }
 
-style "slider"
-{
-  fg[NORMAL] = { 1.0, 1.0, 1.0 }
-  bg[NORMAL] = { 0.0, 0.0, 1.0 }
-  bg[ACTIVE] = { 0.0 ,0.0, 0.5 }
-  bg[PRELIGHT] = { 0.75 ,0.75, 1.0 }
-}
-
-style "ruler"
-{
-  font = '-adobe-helvetica-medium-r-normal--*-80-*-*-*-*-*-*'
-}
-
-style "curve"
-{
-  fg[NORMAL] = { 58000, 0, 0 }                 # red
-}
-
-style "red-bar"
-{
-  bg[PRELIGHT] = { 0.95, .55, 0.55 }
-}
-
-# override testgtk2, introduce the green color in the button list
-style 'button_list' = 'button'
-{
-  font = "-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*"
-  bg[PRELIGHT] = { 0, 0.75, 0x00 }
-}
-widget "main window.*GtkScrolledWindow.*GtkButton*" style "button_list"
-
-# common default
-class "GtkWidget" style "default"
-
-class "GtkScrollbar" style "red-bar"
-
-widget_class "GtkWindow" style "window"
-widget_class "GtkDialog" style "window"
-widget_class "GtkFileSelection" style "window"
-widget_class "*Gtk*Scale" style "scale"
-widget_class "*GtkCheckButton*" style "toggle_button"
-widget_class "*GtkRadioButton*" style "toggle_button"
-widget_class "*GtkButton*" style "button"
-widget_class "*Ruler" style "ruler"
-widget_class "*GtkText" style "text"
-widget "*GtkCurve" style "curve"
+class "GtkWidget" style "defaultfont"
 
 binding "test1"
 {
@@ -120,7 +39,7 @@ binding "test2"
 # lowest
 # gtk         (used by gtk for internal class bindings)
 # application (for hard coded bindings on application basis)
-# rc          (used implicitel by rc files)
+# rc          (used implicitly by rc files)
 # highest
 class "GtkButton" binding "test1"           # implicit : rc
 class "GtkButton" binding : highest "test2" # override "rc" priority
@@ -136,4 +55,3 @@ binding "clist-test"
 }
 
 class "GtkCList" binding "clist-test"
-  
index 1aafdbc2c2f27a047d09b01ccc0292ffab109a6a..e16ee72b65ce663670cbf63bebbc13a5fb065796 100644 (file)
@@ -1867,10 +1867,7 @@ create_pixmap (void)
       button = gtk_button_new ();
       gtk_box_pack_start (GTK_BOX (box2), button, FALSE, FALSE, 0);
 
-      style = gtk_widget_get_style(button);
-
-      pixmap = gdk_pixmap_create_from_xpm (window->window, &mask, 
-                                          &style->bg[GTK_STATE_NORMAL],
+      pixmap = gdk_pixmap_create_from_xpm (window->window, &mask, NULL,
                                           "test.xpm");
       pixmapwid = gtk_pixmap_new (pixmap, mask);
       gdk_pixmap_unref (pixmap);
index e4e6ba72c705f829f0ad63bfbcadc3e2628bf31d..36bb12464292137e1742d8b7e4bdb4328b9f3a36 100644 (file)
 # widget <widget_set> style <style_name>
 # widget_class <widget_class_set> style <style_name>
 
-# testgtkrc2 sets all the buttons in the main window to blue by default
-include "testgtkrc2"
+include "/opt/themes/share/themes/Metal/gtk/gtkrc"
+#include "/home/otaylor/.themes/Ignorant/gtk/gtkrc"
 
-pixmap_path "."
-
-style "default"
-{
+style "defaultfont" {
+#  font = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*,*"
 #  fontset = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*,*"
-  font = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*"
-}
-
-style "window"
-{
-#  bg_pixmap[NORMAL] = "warning.xpm"
-}
-
-style "scale"
-{
-  fg[NORMAL] = { 1.0, 0, 0 }
-  bg_pixmap[NORMAL] = "<parent>"
-}
-
-style "button" = "default"
-{
-#  fg[PRELIGHT] = { 1.0, 1.0, 1.0 }
-#  bg[PRELIGHT] = { 0, 0, 0.75 }
-#  bg[PRELIGHT] = { 0.75, 0, 0x00 }
-}
-
-style "toggle_button" = "button"
-{
-  fg[NORMAL] = { 1.0, 0, 0 }
-  fg[ACTIVE] = { 1.0, 0, 0 }
-  bg_pixmap[NORMAL] = "<parent>"
-}
-
-style "text"
-{
-  bg_pixmap[NORMAL] = "marble.xpm"
-  text[NORMAL] = { 1.0, 1.0, 1.0 }
-  fg[NORMAL] = { 1.0, 1.0, 1.0 }
-  base[NORMAL] = { 0.0, 0.0, 0.0 }
 }
 
-style "slider"
-{
-  fg[NORMAL] = { 1.0, 1.0, 1.0 }
-  bg[NORMAL] = { 0.0, 0.0, 1.0 }
-  bg[ACTIVE] = { 0.0 ,0.0, 0.5 }
-  bg[PRELIGHT] = { 0.75 ,0.75, 1.0 }
-}
-
-style "ruler"
-{
-  font = '-adobe-helvetica-medium-r-normal--*-80-*-*-*-*-*-*'
-}
-
-style "curve"
-{
-  fg[NORMAL] = { 58000, 0, 0 }                 # red
-}
-
-style "red-bar"
-{
-  bg[PRELIGHT] = { 0.95, .55, 0.55 }
-}
-
-# override testgtk2, introduce the green color in the button list
-style 'button_list' = 'button'
-{
-  font = "-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*"
-  bg[PRELIGHT] = { 0, 0.75, 0x00 }
-}
-widget "main window.*GtkScrolledWindow.*GtkButton*" style "button_list"
-
-# common default
-class "GtkWidget" style "default"
-
-class "GtkScrollbar" style "red-bar"
-
-widget_class "GtkWindow" style "window"
-widget_class "GtkDialog" style "window"
-widget_class "GtkFileSelection" style "window"
-widget_class "*Gtk*Scale" style "scale"
-widget_class "*GtkCheckButton*" style "toggle_button"
-widget_class "*GtkRadioButton*" style "toggle_button"
-widget_class "*GtkButton*" style "button"
-widget_class "*Ruler" style "ruler"
-widget_class "*GtkText" style "text"
-widget "*GtkCurve" style "curve"
+class "GtkWidget" style "defaultfont"
 
 binding "test1"
 {
@@ -120,7 +39,7 @@ binding "test2"
 # lowest
 # gtk         (used by gtk for internal class bindings)
 # application (for hard coded bindings on application basis)
-# rc          (used implicitel by rc files)
+# rc          (used implicitly by rc files)
 # highest
 class "GtkButton" binding "test1"           # implicit : rc
 class "GtkButton" binding : highest "test2" # override "rc" priority
@@ -136,4 +55,3 @@ binding "clist-test"
 }
 
 class "GtkCList" binding "clist-test"
-